Let mysqldump help you!
Posted by Erik Bauffman in default on June 17, 2011
I used to dump mysql data using PHPMyAdmin. People should get kicked in the nuts for doing that.
Dumping a (remote) database:
mysqldump -uroot -proot –host=mysql.openminds.be my_database > Desktop/dump.sql
Restoring a database:
mysql -uroot -proot my_database < Desktop/dump.sql
Disclaimer: I know that it’s stupid to set the password in the command, but this is just for the example. /cc @adeepersilence
Git checking out a remote branch
Posted by Erik Bauffman in default on June 1, 2011
I need to checkout remote branches from other repo’s quite a lot. Mostly these repo’s are forks from the repo that I’m on. An example of what I do to make this go smooth without having to create a local branch (which is based on the master).
git remote add janmoesen https://github.com/janmoesen/forkcms.git
git fetch janmoesen
git checkout -b janneman janmoesen/rewrite-navigation-cache-file
I now have a new branch ‘janneman‘ that does not contain any nasty merge commits because I checked it out in one step.
ps: I used to follow the steps on github.com to get a branch from another repo, but they make you create a branch locally before pulling from that remote branch. If you do so, you will get a merge commit and I don’t like that.
Git diff not very clear
Posted by Erik Bauffman in default on May 26, 2011
From time to time I have to mess in code that I haven’t written. Some of those other developers don’t trim whitespaces or blank lines which makes my git diff look kinda messy. There’s a solution for this.
‘git diff’

‘git diff –ignore-space-change’

MySQL command line import
Posted by Erik Bauffman in default on May 24, 2011
I always seem to forget the right command.
mysql -uroot -proot databaseName < /location/to/my/file.sql
Verslag team skills management
Posted by Erik Bauffman in default on March 15, 2011
Voorbije zaterdag heb ik een opleiding ‘team skills management‘ gevolgd van JCI Gent. Van ‘smorgens tot ‘savonds kon ik, in het bijzijn van 11 andere geïnteresseerden, een uiteenzetting krijgen over de verschillende teamrollen die er bestaan. Het deed me denken aan de MBTI sessie die we een tijd terug met Netlash hebben gedaan, maar dan met andere types, gebaseerd op de studies van Dr. Meredith Belbin. Op zich een interessante kijk op de verschillende rollen binnen een team, maar niets nieuw onder de zon. De praktijkoefeningen waren leuk, maar zouden een stuk interessanter zijn bij mensen die effectief in een professionele omgeving moeten samenwerken.
Mijn conclusie is twee-ledig. Enerzijds leert het dat iedereen een verschillend type of meedere types is en dat je, indien je hiermee rekening houdt, beter kan samenwerken. Je kan hierdoor ook een betere team setup maken als je personen enigszins probeert in te schatten op die manier. Anderzijds, leert de realiteit in het bedrijfsleven echter dat als er een nieuwe werknemer nodig is; dat we iemand laten starten als hij/zij aan de vereisten voor de functie voldoet. Of die persoon dan geschikt is om samen te werken met de anderen in dat team waarin hij/zij terechtkomt en een gebalanceerd geheel te vormen, dat wordt in het midden gelaten. De grootte en visie van de organisatie zal natuurlijk een rol spelen.
Voor de rest niets dan lovende woorden voor de organisatoren en in het bijzonder de sprekers waaronder Guy De Veth.
Digicorder scart
Posted by Erik Bauffman in default on March 9, 2011
Note to self: Als je een digicorder hebt die aangesloten is met een scart kabel, dan moet je opletten dat je de dpi niet te hoog instelt. Doe je dit wel dan kan je niet langer aan je menu’s. Resetten helpt niet, je moet back + > drukken op je digicorder zelf om dit te resetten.
MySQL connections in Zend Studio 8.0
Posted by Erik Bauffman in default on November 23, 2010
Recently I was having problems to get my unit tests to connect to my local MySQL server when ran within Zend Studio 8. After some reading on the internet it seems, that this issue is caused by the MySQL server running on the default port (3306). I’ve changed this to 8889 as MAMP (on mac) suggests and now it works like a charm.
call_user_func(_array) behaviour in PHP 5.3
Posted by Erik Bauffman in default on November 8, 2010
Before PHP 5.3 you could use call_user_func and call_user_func_array even if you didnt provide an array with parameters. Since 5.3, this results in a ‘NULL’ without actually executing this method/function.
// works in < 5.3, but fails in > 5.3
$moduleItems = call_user_func_array(array($className, ‘getByTag’), $this->id);// works everywhere
$moduleItems = call_user_func(array($className, ‘getByTag’), $this->id);
In all honesty, it’s normal that it shouldn’t work when you don’t provide the right parameters. However a decent notice would let me know that something is wrong.
Strange mysql sorting behaviour with enums
Posted by Erik Bauffman in default on September 23, 2010
If you have an ENUM(‘Y’,'N’) field and you want to sort ASC on this field, mysql will show the Y values before the N values. It seems this is based on the order you defined them when creating your table… See the screenshot.

I’d like to add the explanation from mysql.com which can be found here.
ENUM values are sorted according to the order in which the enumeration members were listed in the column specification. (In other words, ENUM values are sorted according to their index numbers.) For example, ‘a’ sorts before ‘b’ for ENUM(‘a’, ‘b’), but ‘b’ sorts before ‘a’ for ENUM(‘b’, ‘a’). The empty string sorts before nonempty strings, and NULL values sort before all other enumeration values. To prevent unexpected results, specify the ENUM list in alphabetic order.
Midas, hoofdpijn zonder zorgen
Posted by Erik Bauffman in default on July 27, 2010
Aan die klootzakken die een camion uitlaten moesten lossen om 03u45 vannacht bij Midas (aan de achterkant van mijn appartement):
Vraag de code van het alarm zodat je de hele buurt niet moet wakkermaken. Dank bij voorbaat!