Code visualization with Gource

Writing code has its perks for sure and for me one of these is the satisfaction of being able to think of something and then just write the code to bring it to life.

After all the writing, testing, debugging and adding and removing lines and lines of code it’s nice to be able to look back and visualize all the hard work that you have put into creating your pet project.

Continue reading “Code visualization with Gource”

PhpUnit and XDebug

If you would like to debug one of your command line scripts using PHPUnit then you need to export one of the XDEBUG_CONFIG values. I read one post about this (unfortunately lost the link and cannot place it here as a reference) the general idea was to export the configuration for XDEBUG and then run phpunit as you would normally do.
So, let’s say that you are using PHPStorm as your IDE then the script would be:

#!/bin/bash

export XDEBUG_CONFIG="idekey=PHPSTORM";
phpunit $@

If you name the script phpunitx then the only thing that you would need to do to run PHPUnit from the command line with XDEBUG enabled would be to invoke phpunitx instead of phpunit.

How to start Chromium with specific user

As you may already know it is possible to create different profiles for Chromium. You can find out more information about that in http://www.chromium.org/user-experience/multi-profiles.

What I was really interested to find out was how can I start Chromium with one of these profiles, instead of using the last one that was loaded. The answer can be found here: http://superuser.com/questions/377186/how-do-i-start-chrome-using-a-specified-user-profile. Unfortunately the man page for chromium does not list the specified option so it was really nice to find this question in superuser.com! But let me just give an example of how to use it under Linux.

Continue reading “How to start Chromium with specific user”

Phing CopyTask

Phing is a PHP build tool that you might be familiar with or you might be already using. The official Phing website can be found at http://www.phing.info/ and the initials stand for PHing Is Not GNU make. You can download or install it as a PEAR package and as long as you are a bit familiar with XML it is really easy to learn how to use. So, if you are reading past this point it means that you have actually used Phing before and that you are familiar with its CopyTask for copying individual files or filesets from one location to another.

Recently I was trying a new build file with Phing and came accross an interesting issue. The result of building a target that included copying a previously defined fileset from one location to another had a somewhat unexpected  result. An empty folder that was contained in the source location for which all users had read, write and execute permissions on, was copied accross but the permissions were not kept. I was not receiving any errors and the folder was actually created in the destination folder. As it turns out the version of Phing that I was using did not support copying an empty folder with its permissions to a new location. So if you are having a similar issue do upgrade your  package to the 2.5.0 version of Phing (as of the time of writting this is the latest stable release of Phing on PEAR). You can perform the upgrade quite easily as you would with any other PEAR package.

How to set/unset options in Vim

Vim is a very powerful text editor and as such it has lots of options which allows you to configure it “just right” for you! In order to configure it you can set up values to its various options either in the current window you are working on or in configuration file so that every new instance launched will have common settings. This file is usually called vimrc and is located under your home catalog.

But what happens if you wish to reset the value of an option you have configured in this configuration file for just this window that you are currently working in? I found that to be more difficult than expected so, here is how you can:

  1. Start a clean instance of vim with all its default options that ignores all the settings in all the user defined configuration files
  2. Get the currently set options and their values
  3. Disable/reset options that I will call switches
  4. Reset any option to each default value (whatever that might be)
Continue reading “How to set/unset options in Vim”

Boxplots using R – Multiple values

(This post explains how to use R to create multiple boxplots in the same graph)

If you have been using R with Rcmdr and have taken a look at the boxplots that you can create with it, then you already know that there are not many options that you can set for the plots. You can only create a boxplot based on one variable from your active dataset (variables with data that you have loaded in your current workspace).

Continue reading “Boxplots using R – Multiple values”