Last posts

How to setup a WAMP working environment

Most of you probably work on multiple projects, at the same time, with multiple workspaces defined in your IDE, with different Apache server configurations on each of them. That’s a lot of variables, isn’t it? What about unifying things? What about getting all together? In the last years, I’ve managed to work with several server configurations, but most of them focused on Apache (both v1 and v2). Experience tells me that separating server from your workspace is the best way to do:

  1. your projects should not be in the server’s folder
  2. all projects should be in one folder, a workspace
  3. both projects and workspace should not be near the OS (I’m thinking about Windows here)

So, either you work on Windows, OS X, or Linux, either you use XAMP, WAMP or MAMP, or pure httpd/apache, your system&server configuration can be used for multiple projects. Bellow I’ve sketched a step-by-step guide on how to rapidly configure a Win box for this purpose. The guide can be ported to both OS X & Linux machines, with the appropriate software. Here we go:

  1. download WampServer
  2. install wampserver in a E:\server folder
  3. sort & get your projects into a E:\workspace folder
  4. open E:\server\bin\Apache2.2.11\conf\httpd.conf
    • enable mod_rewrite.so by removing the hash sign
    • enable conf/extra/httpd-vhosts.conf by removing the hash sign
  5. now, for each domain.tld you should:
    • open C:\windows\system32\drivers\etc\hosts
      • add the following line
      1
      127.0.0.1               domain.tld
    • open E:\server\bin\Apache2.2.11\conf\extra\httpd-vhosts.conf
      • replace the old NameVirtualHost by commenting the directive, and add a new record for each domain
      1
      2
      #NameVirtualHost *:80
      NameVirtualHost domain.tld
      • add following for the localhost
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      <VirtualHost localhost>
          ServerAdmin webmaster@localhost
          DocumentRoot "E:/server/www"
          DirectoryIndex index.php
          <Directory "E:/server/www">
              AllowOverride All
              Allow from All
          </Directory>
          ServerName localhost
          ErrorLog "logs/localhost-error.log"
          CustomLog "logs/localhost-access.log" common
      </VirtualHost>
      • add vhost settings for your domain.tld, and for each other domains, as much as you want
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      <VirtualHost domain.tld>
          ServerAdmin webmaster@domain.tld
          DocumentRoot "E:/workspace/domain.tld"
          DirectoryIndex index.php
          <Directory "E:/workspace/domain.tld">
              AllowOverride All
              Allow from All
          </Directory>
          ServerName domain.tld
          ErrorLog "logs/domain.tld-error.log"
          CustomLog "logs/domain.tld-access.log" common
      </VirtualHost>

Now you can happily drink a beer and enjoy! ;)

How to add a new (FTW.ro) button to SexyBookmarks Plugin 2.6.1

Last week a good old friend of mine asked me if there’s a way to add another (?!?!) button/site to the SexyBookmarks site. I was a bit shocked: SexyBookmarks can “share”/”bookmark” your post to almost 54 sites/social networks/web applications. So why another one?! The answer came quick: because it’s not in that list, you moron! Okie, okie. Got it! It is about FTW site, which is some kind of article aggregator, dedicated to romanian bloggers. Okie! Now that makes sense, and it seems that my friend really needs that kind of feedback.

So, what do you need to start:

  1. latest version of WordPress, mine is 2.8.6
  2. latest version of SexyBookmarks, mine is 2.6.0.1 2.6.1
  3. latest version of One Half Hour Available :)

Lets begin:

  1. We’ll have to modify a few files that are in the plugin’s folder …/wp-plugin/plugins/sexybookmarks/, declared as {root} in the following lines:
    • {root}/includes/public.php
    • {root}/includes/bookmarks-data.php
    • {root}/css/admin-style.css
    • {root}/css/style.css
    • {root}/images/sexy-sprite.png
  2. In {root}/includes/public.php add the following block of elseif code at line 457:
    457
    458
    459
    460
    461
    462
    463
            elseif ($name=='sexy-ftw') {
                $socials.=bookmark_list_item($name, array(
                    'post_summary'=>$post_summary,
                    'permalink'=>$perms,
                    'title'=>$title,
                ));
            }
  3. In {root}/includes/bookmarks-data.php add the following array element at line 359:
    359
    360
    361
    362
    363
        'sexy-ftw'=>array(
            'check'=>__('Check this box to include ', 'sexybookmarks').__('FTW', 'sexybookmarks').__(' in your bookmarking menu', 'sexybookmarks'),
            'share'=>__('Share this on ', 'sexybookmarks').__('FTW', 'sexybookmarks'),
            'baseUrl'=>'http://www.ftw.ro/node/add/drigg/?url=PERMALINK&amp;title=TITLE',
        ),
  4. In {root}/css/admin-style.css add the following code at line 186:
    186
    label.sexy-ftw{ background-position:-5120px top !important; }
  5. In {root}/css/style.css at line 84 35, there’s a very long-lined list of CSS selectors. Add the following two, just before the curly opening brace:
    35
    ..., li.sexy-ftw,  li.sexy-ftw:hover {

    and

    182
    183
    li.sexy-ftw { background-position:-5120px bottom !important; }
    li.sexy-ftw:hover { background-position:-5120px top !important; }
  6. Add this image into the images folder and override the current {root}/images/sexy-sprite.png

Now that everything went well :D (hoping so), do your settings into the plugin preferences page and bring the FTW icon into the bar! Be happy and wait for feedback from FTW! :)

MooTools(more, core, mocha).bestFrameworkEver()

I insist.

I’ve been working for more than 5 years with all kind of javascript codes, libraries, frameworks, a.s.o. but, there wasn’t one to satisfy my needs as Mootools does (and don’t go dirty-thinking :) ). Why?

  1. because all world-wide-known JS libraries are trying to be modular and well structured, but MooTools beat’em all
  2. because all libraries implement “chainability” but no one does it better than MooTools
  3. because Core & More can offer you 99.9% of what you need to implement in a website/application UI
  4. because MochaUI is a tool that has a lot more to show than any other UI wrapped around JS library
  5. and last but not least… it just ROCKS!

Ok now. Google all what you need and let me know if I’m right or wrong! Have fun!

chainability


Copyright © 2004–2009. All rights reserved.

RSS Feed. This blog is proudly powered by Wordpress and uses Modern Clix, a theme by Rodrigo Galindez.