·

Webdevelopment

Making the internet a more beautiful place day by day since 2006.

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 ...

Unit testing in Magento with PHPUnit

So maybe you’re familiar with unit testing in PHP, maybe not. But when it comes to Magento, there are some thinks to consider when you want to write unit testable code. Now I know, you could use some already existing framework for unit testing in Magento, like EcomDev PHPUnit for example, but if you’re like read further ...

Fixing Vagrant port forwarding on OSX Yosemite

Update: it didn’t seem to work as expected so with a little help of this article I changed to code a bit. So recently I updated my system to OSX Yosemite. As you might know, I work with Vagrant, and one major aspect for local development is forwarding port 80 of my host machine to read further ...

Split content with a horizontal rule

Today I want to share a little technique with you that I use for much of my clients. There are many times when you need the content to be split in two in the frontend. Think about a custom wrapped header, a text in 2 columns, an introduction, etc. In my opinion the client must read further ...

How to process HTML with grunt

Grunt is an indispensable tool when you’re in the business of web development. It takes away so much of the repetitive tasks for you so you can focus on what really matters. The other day I mentioned the use of Grunt in a basic build setup with Jenkins. One of the aspects of this build process read further ...

htmlspecialchars(): Invalid multibyte sequence in Magento

So if you use the $this->escapeHtml() -method in a template in Magento, you might have come across an error something like this: The problem here is a bug in older PHP versions where the combination of display_errors=off  and multibyte string throws this error (yeah that’s right…). The fix is rather simple. Instead of directly passing your value read further ...

A Basic Grunt setup for building

Today I want to share a basic Grunt setup with you. I’m currently in the stage of my project where I have to setup the build instructions for Grunt.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 ...

1 3 4 5 6