·

How to

Tips & tricks, tricks & tips. Looking for a way to achieve something? Here’s how to do it!

Find translateable strings in Magento PHP Files

So here’s a nice little one-liner you can use to find strings that require translation in your Magento projects. Just go to the folder of your theme or extension and execute the following command: What it does, it looks for occurances of __(‘ anything ‘)  in your code and creates a typical Magento CSV-translation string read further ...

Mass convert m4a files to mp3 on OSX

Let me start by saying that I recently switched from an iPhone to Android. When I wanted to put my music on my new phone I discovered that my new phones’ music player didn’t recognise the m4a  in which many of my audio files were encoded. So I needed to find a way to convert my read further ...

Drawing a smooth bezier line through several points

So as some of you might already know, I’m experimenting a bit with SVG lately. Especially the part of procedural generated SVG I find very interesting. One aspect of drawing in SVG is generating smooth lines through several points. You can simply draw bezier curves to get smooth lines, but how do you know where read further ...

Solving ‘Too late for the schedule’ with Magento crons

You’ve probably all encountered the ‘Too late for the schedule’-error in Magento at some point in your career as a Magento Developer: A cron is not working, and when you check the cron_schedule  table in your database, you see numerous records with this message. This error occurs when the Magento cron is trying to run a read further ...

Mass rename files in Unix with iteration index

I already wrote a post a while ago about how to mass rename files in Unix. But today I was faced with the challenge to do the same trick, except rename each file to an increased number. I had a whole folder with all kind of PNG images, and I had to rename them to read further ...

Create an install- or upgrade script in Magento that creates a product attribute

When writing Magento Modules (or updating them), you’ll often find yourself in the situation where some of the functionality depends on the presence of a specific product attribute. As you know, you can use an installer script to create product attributes programmatically, just like you can create static blocks programmatically. Since I encounter this situation read further ...

Quick Tip : Correctly set the headers of your maintenance page

When you’re deploying updates or migrating entire sites, you probably used a maintenance screen before: a simple screen telling the visitor that there is some major stuff going on on the server and that the site will be back online in a few moments. It’s important that you don’t lose any precious SEO-value of your read further ...

How to write unit tests for your websites’ JavaScript with Mocha

As some of you might know, I’ve already written a lot of posts about unit testing in PHP. But what about your JavaScript? That might require testing too. Especially when it comes to critical functions that involve complex operations. One road you could take to do this is use a headless browser and a testing read further ...

Generate a SVG star in PHP

Don’t ask my why, but today I had to draw a star with SVG. Being just math, this is easy to do with some basic sinus- and cosinus-calculations. So here’s how you can create this SVG graphic with PHP:read further ...

1 2 3 4 5 6 10