Thomas Aylott, the author of the JavaScript Bundle for Textmate, announced that he added the completion feature to his package. This is great news. as far as I know, this is the first completion made available for Textmate and I understand it is easily extended so we could see several other languages being supported soon. If that’s the case, this will make Textmate a real contender not only to text editors but full featured IDE. This is exiting.

To install the bundle, just head over to Thomas Aylott’s GitHub page and download the Javascript bundle (not the Javascript-tools one) and extract it. Rename the generated folder javascript.bundle and double click it. Once the bundle is installed, enter the beginning of a javascript line of code and press option+escape to show the completion.

At first, I was getting the following error message in Textmate:

1
/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- json (MissingSourceFile)

It was fixed by running the following command

1
sudo gem install json

First, I must confess that I like trying software out. That’s probably how I ended up having some many accounts with so many services and having a Tumblelog AND a Wordpress blog. Since this blog is not running on wordpress.com, it is for me to remember and backup my database and files from time to time in case of a problem with my server. For my Tumblr, it is different. The data is on Tumblr server(s) and there are no features I know of in the admin to download them and store them locally. After a year of publishing a daily list of the movies I watch and books I read, this tumblelog became a Journal of my cultural activities and I grew attached to it. Recently I decided it had to be backedup in case something happened to my tumblr account or whatever. As usual, someone had the idea before me and a tool is available. It is called – appropriately enough – Tumblrbackup. It couldn’t be easier to use, enter your credentials, select the tumblelog to backup and the destination on your computer. A folder is created which contains your posts, images, avatar and even your custom style. A index.html file is generated allowing you to browse your own content on your local hard drive. The index.html doesnt include your custom style so it looks pretty plain but everything you wrote and uploaded is there… Now I just need to remember and rerun the backup from time to time. Cool!

I don’t remember how I’ve heard about Chive, a young alternative to PhpMyAdmin (version 0.3 was released less than a week ago). I believe it was a link on twitter.
There seem to be two policies when it comes to a MySQL browser for web developers: the desktop app or the web app. A lot of people seem to use PHPMyAdmin though I gave it up several years ago. First for the MySQL QueryBrowser, later on for SequelPro (OS X). SequelPro does everything I need, connect via socket, tcp or ssh which is extremly useful. Still, sometimes, to install a PHPMyAdmin (or something similar) on a remote server or a dev server can be handy. So I tried Chive.

The installation couldnt be easier. Just unrar the package, place it in your document root somewhere and it works. Chive runs on the Yii PHP framework and, as far as I can tell, it’s pretty fast. The interface is less cluttered than PHPMyAdmin. Of course, you have to get some work done with a tool like that to judge of its efficiency but it looks like a nice alternative to PHPMyAdmin to me. Actually, the feature list comparaison on the Chive website is impressive (considering the age of the project). I will definitely recommend it to developers I work with because I hate using PHPMyAdmin when pairing with them.

If you have any use for a web based MySQL Browserm check Chive out:

  • Chive homepage
  • Chive’s source code on launchpad
  • Before I was a mac user, I have used Windows and Linux for several years. I still use Linux daily (via SSH) and I still see Windows running on machines all around me. From these two worlds, there are very few things that I am missing on Mac OS X.

    From the Windows world, I would like to get AnyDVD, DVD Shrink (that is a cool name for a cool soft) and IrfanView. From my Linux setup, there is one thing that I’ve missed: Amarok.
    Every now and then I try to compile Amarok on my mac. So far I had tried using MacPorts but this week end, I found out it could also work using FInk so I tried to install it. Fink is a linux port for Mac OS X which works pretty closely to aptitude on Debian.
    The installation, on Snow Leopard, can only be done from the source but it’s simple enough:

    Install Apple XCode
    Download the Fink source
    Untar the package

    1
    2
    <br />
    tar -xvzf fink-0.29.10.tar.gz<br />

    Launch the bootstarp file

    1
    2
    3
    cd fink-0.29.10<br />
    ./bootstrap</p>
    <p>

    Add fink to your path

    1
    /sw/bin/pathsetup.sh

    Update fink

    1
    fink selfupdate

    Finally, in order to install Amarok, switch to the unstable branch by doing

    1
    fink configure

    update your fink distribution again

    1
    fink selfupdate

    And try installing Amarok

    1
    fink install amarok

    It doesn’t compile for me at this point (it failed on kdebase) but I’ll try again. In the meantime, fink works.

    This week I’ve worked on a social lightbox for Teeorama allowing our visitors to tweet or write on their Facebook walls from our tee-shirt shop.The lightbox itself is built using ColorBox, a powerful and customizable lightbox library built on JQuery (MIT License). The Twitter tool is fairly easy to setup, I used bit.ly to generate the shortened URL of the current page and placed it, along with a default content, in the text box. When the user clicks on submit, he or she is redirected to twitter. The update box contains what was typed in the teeorama box and one click on the update button is enough to validate the tweet.The follow button is even simpler, it is nothing but a link to teeorama’s twitter account.Facebook is both more powerful (you can publish to your wall without leaving the teeorama page) and a bit trickier to setup.First, you need to head over to developers.facebook.com/setup.php to register your site as a Connect enabled website. Upload the xd_receiver.htm file to your server and validate. You now have access to your Facebook Connect Tools, API documentation and sandbox as well as to a gallery of widgets or code samples you can use. I chose to use the Comment Box.

    I switched my dev. environnement at work from MAMP to Zend Server Community Edition a while ago but was disappointed that my Mac Book could not migrate because of a MySql error. Every time I would try to run the server, I would get the following error:

    1
    ERROR! MySQL PID file could not be found!

    Googling this error, all kinds of solutions came up: privileges on the files, misconfiguration issues, installation problems…
    It seems to be a generic message. After trying to understand what might have happened to the missing PID file, I tried re-installations and all the common MySql on Mac OS X tips I could find on Google. No luck. At least, MAMP worked.

    Eventually, the same error occured on alheim’s computer. He eventually found a solution which worked for him (SnowLeopard running on Mac Book Pro) for my own laptop as well (Snow Leopard on a black MacBook).

    So here are the steps we took:

    1
    2
    3
    4
    5
    cd /usr/local/zend/mysql
    sudo scripts/mysql_install_db
    sudo chown -R zend:wheel data
    cd ..
    sudo bin/zendctl.sh start-mysql

    Hopefully, you’ll get a “SUCCCESS” message, too. Thanks to Alheim for the tip.

    Recently, I wrote about geolocalisation of your users/visitors based on the IP to Country table. After using it for a couple of months, I found it painful to have to regularly update the table (even if some people came up with an automatic work around based on PERL scripts for example).

    So, I decided to find another way to solve the problem and gave the GeoIP Apache module by MaxMind a try. The installation is as simple as can be:

    1
    2
    3
    aptitude install libapache2-mod-geoip
    a2enmod geoip
    /etc/init.d/apache2 restart

    Once the module is setup, you can use the following PHP code to obtain the Country Code (2 letters)

    1
    $countryCode == $_SERVER["GEOIP_COUNTRY_CODE"];

    Finally, here is a list of country codes and the associated country names.

    If yo

    That’s it, quick and simple.

    A very quick post to list the languages supported by Code Colorer which I use on this blog. Everytime I write I find myself wondering which language is supported and how I should write it out for the plugin to work so here it is, for the record:

    • ABAP
    • ActionScript
    • ActionScript 3.0
    • Ada
    • Apache
    • AppleScript
    • Apt sources.list
    • asm
    • asp
    • autoit
    • avisynth
    • bash
    • basic4gl
    • bf
    • bibtex
    • blitzbasic
    • bnf
    • boo
    • c
    • c_mac
    • caddcl
    • cadlisp
    • cfdg
    • cfm
    • cil
    • cmake
    • cobol
    • cpp-qt
    • cpp
    • csharp
    • css
    • d
    • dcs
    • delphi
    • diff
    • div
    • dos
    • dot
    • eiffel
    • email
    • erlang
    • fo
    • fortran
    • freebasic
    • genero
    • gettext
    • glsl
    • gml
    • gnuplot
    • groovy
    • haskell
    • hq9plus
    • html4strict
    • idl
    • ini
    • inno
    • intercal
    • io
    • java
    • java5
    • javascript
    • kixtart
    • klonec
    • klonecpp
    • latex
    • lisp
    • locobasic
    • lolcode
    • lotusformulas
    • lotusscript
    • lscript
    • lsl2
    • lua
    • m68k
    • make
    • matlab
    • mirc
    • modula3
    • mpasm
    • mxml
    • mysql
    • nsis
    • oberon2
    • objc
    • ocaml-brief
    • ocaml
    • oobas
    • oracle11
    • oracle8
    • pascal
    • per
    • perl
    • php-brief
    • php
    • pic16
    • pixelbender
    • plsql
    • povray
    • powershell
    • progress
    • prolog
    • properties
    • providex
    • python
    • qbasic
    • rails
    • rebol
    • reg
    • robot
    • ruby
    • sas
    • scala
    • scheme
    • scilab
    • sdlbasic,
    • smalltalk
    • smarty
    • sql
    • tcl
    • teraterm
    • text
    • thinbasic
    • tsql
    • typoscript
    • vb
    • vbnet
    • verilog
    • vhdl
    • vim
    • visualfoxpro
    • visualprolog
    • whitespace
    • whois
    • winbatch
    • xml
    • xorg_conf, xpp
    • yaml
    • z80

    An impressive list which should be handy next time I post anything.

    Before you jump and get a real Search Engine for your website, you might try the MySQL full text search feature.

    It is incredibly easy to set up. All you need to do is setup the table and fields to be searchable as full text with the following command:

    1
    ALTER TABLE Table_Name ADD FULLTEXT(field1, field2);

    Then, simply write a query using “match” to run your searches:

    1
    SELECT * FROM Table_Name WHERE MATCH (field1, field2) AGAINST ('search_query')

    Happy Valentine’s Day

    Setting up Code Igniter

    February 13, 2010 | 2 Comments

    A few months ago, we jumped into Teeorama, a PHP based online tee-shirt store front end for Spreadshirt. We finally completed the project and we’re planning on opening it to the public tomorrow. By the way, if you feel you could use a new Geek shirt, please head over to teeorama.com before reading on…

    When I started the development, I decided to use both a PHP and a Javascript framework I didn’t know. I had two reasons for doing that:

    • It’s always interesting to play with new code. You get to see how other people/framework solved common problems, how some libraries make this or that easier  to use for the developer. You also sometimes realize some other things are carried out better in the framework you are used to. Either way, it is a good learning experience.
    • Also, I wanted to stay away from the stack we use at work to not be tempted and not be able to just copy over bits of our blueKiwi framework into my code

    So, I picked CodeIgniter and jQuery to build my website. In the end, I am very pleased with the experience of working with these two tools. CodeIgniter is exactly what it claims to be: a very light but powerful framework that does not try to command the way you work. Of course, jQuery is just as powerful as its reputation. It’s incredibly easy to get used to and I haven’t found anything it couldn’t do.

    Anyway, this post is about setting up Code Igniter. There is a Code Igniter user_guide (included in the downloaded zip file) to do just that and it would take you about two seconds to get going. The thing is, I did not like the way Code Igniter was laid out in my folder. I wanted to be able to place the framework in a library folder within my application folder and make my web folder (containing the images, javascript and css files) the document root therefore keeping my application folder out of exposure to the Web.

    This is also possible though it does involve some minor tweaking of CodeIgniter base code.

    First, here is my chosen folder layout

    Second, as I said, I made the web folder the target of my Apache virtual host.
    Here is my virtual host for this application

    1
    2
    3
    4
    5
    6
    7
    8
    ServerAdmin your_email
    ServerName project_domain
    AddDefaultCharset UTF-8
    DocumentRoot /var/www/project/web

    RewriteEngine On
    RewriteCond $1 !^/?(index\.php|test|images|web|js|css)
    RewriteRule ^(.*)$ /index.php/$1 [L]

    Finally, in order for all this to work, you need to tweak a couple of CodeIgniter files

    define the system and application folders paths as follow in index.php:

    1
    2
    3
    $docRootPath = dirname($_SERVER['DOCUMENT_ROOT']);
    $system_folder = $docRootPath."/application/libraries/codeigniter";
    $application_folder = $docRootPath."/application";

    Also, modify the CodeIgniter.php file at the bottom of index.php to:

    1
    require_once BASEPATH.'CodeIgniter'.EXT;

    Finally, edit CodeIgniter.php in order to replace all occurrences of “codeigniter/” by “” (nothing)

    You should be setup. Happy coding!


    Next Page >>