·

terminal

Migrate MySQL databases with stored procedures

Ever tried to migrate a MySQL database with stored procedures or views? Ever ran into the error “The user specified as a definer does not exist”, or “Access denied; you need (at least one of) the SUPER privilege(s) for this operation”? Chances are that you are trying to migrate a MySQL database with stored procedures or views. read further ...

PHP as a CLI language

Some of you might already know this, but I use PHP as a CLI language quite often. And why not? It’s PHP, the language I know best. It has access to the file system so you can do all kind of magic with it. Like any shell script it’s great for maintenance, scaffolding or periodic read further ...

Converting multiple MySQL INSERTS into a single statement

So I had to import this huge MySQL database the other time and I had the problem that each INSERT -statement only contained 1 row of data. Now, for a small database this is not a big deal, but for a database that’s 1GB or more importing all these separate rows takes forever! So i had read further ...

Unit test with a test database

When writing unit tests, you sometimes have to test if function did proper operations to the database. Simple CRUD-operations for example: you want to test if your code is affecting the database like you intended. Or for more complex situations, like imports or mass mutations you want to be able to test everything thoroughly. Now, read further ...

Remove cached files in your Git history

So today I stumbled upon an issue where I was unable to remove a chunk of code that was left in my repository for some reason. I accidentally added a 1.2 Gib database dump and after I removed it from my repository and git rm –cached  it, Git would still try to to push this huge read further ...

Poor mans’ multithreading in PHP

I’m currently writing an application in which multiple requests are send out to multiple servers. I do this with a CLI script I wrote in PHP (since that’s the language I’m most familiar with). I wrote a simple foreach() -loop in which I made my requests to the server, analysed the response and logged them. Now, the read further ...

How to install XDebug on OSX

As a follow-up on my previous post, this post explains how you can easily install XDebug on your OSX webdevelopment configuration, making your life as a developer a whole lot easier.read further ...

How to prepare OSX for local webdevelopment

In this article, I will explain how you can setup an Apache/Mysql/Php-server on OSX for your local development. The fun part is that I will also explain how you can configure OSX so that requests to http://*.dev/  are being transfered to the right directory.read further ...

Create an archive of changed files in your GIT repository

Often I find myself updating my clients’ websites. This can be a simple bugfix or a major update, but eventually I always end up transfering updated files to the FTP-server. Lucky for me, GIT allows me to create a simple archive with only the modified files, making deploying changes to a webserver so much more read further ...

1 2