Author Archives: bendog

phpMyAdmin showing a 500 error after a WHM/cPanel upgrade

I did an upgrade to WHM/cPanel server today. Moved it to the latest cPanel software and did an easyApache upgrade to the latest php 5.3. All worked smoothly until I launch phpMyAdmin. No worky, dang. This one had me puzzle for a while. The crazy part is that I couldn’t find an error in the log. Turns out.. that when the upgrade happened, because it’s now php 5.3, the phpMyAdmin config file doesn’t set a…

Read More

Lemonstand Module – Dog Tools

Started a Lemonstand Module where I plan to add a few helpful developer items. Just one helper in there, the Dumb Gateway payment type: Dumb Gateway was never the smartest in class. Dumb Gateway goes nowhere and does as it feels. Add Dumb Gateway and set the mood. When Dumb Gateway is Happy, payment goes well. When Dumb Gateway is Sad, payment goes poorly. Sometimes Dumb Gateway is undecided. Dumb Gateway likes developers, but Dumb…

Read More

Zero-padding (and other things) a string with the Twig template engine

This might sound a bit “duh” when you come to the conclusion but I did have to search for it and couldn’t find an immediate answer. I want to zero-pad a month variable to always be 2 digits long, using the Twig template engine Twig doesn’t actually have a built-in filter for this. {{month|pad(‘0+’,2)}} doesn’t exist. However, Twig does have a filter called format that gives you access to the power of sprintf. You can…

Read More

Building a custom ITX HTPC computer with wooden case mod – Part 3

Welcome back for yet another riveting post on my computer building adventures. If you haven’t read Part 1 or Part 2 of this excellent writing exercise, well you oughta! So now I have the box for the case. What I’m going to do next is making some measurements and working out how everything will fit in, then I will start on cutting and drilling process. To do this though, I am going to need a…

Read More

Building a custom ITX HTPC computer with wooden case mod – Part 2

Welcome back. If you haven’t read Part 1 of this excellent writing exercise, well you oughta! In Part 1 I briefly outlined the choice of hardware for the system. In Part 2 I’ll present the design aspects of the case. The Case I’m not 100% crazy, I do not have the skills, nor the tools to build a wooden case all from scratch. My initial idea was to find an old wooden box, from a…

Read More

Building a custom ITX HTPC computer with wooden case mod

I’ve wanted to do this for quite some time now. I have been custom-building my own desktop computer for a long time now. It pretty much just comes down to picking the right components and placing them in a good ATX case. Building an ITX/HTPC computer is kind of the same, except everything is smaller and therefore a bit more challenging. Trying to do this in a custom case ramps up the difficulty level even…

Read More

Adding conditions to relationships in Laravel

Currently playing with the Laravel php framework. It’s been said by many already, it’s a really cool framework. Well designed and documented. Coming from a CodeIgniter background, it’s easy to jump in and refreshing to get all the new cool features. The Eloquent ORM has a nice minimalist approach to writing database abstraction. If you’re coming from Propel or Doctrine it’s crazy how little you actually need to get Eloquent going. Eloquent supports relationships between…

Read More

Show custom image sizes in the WordPress’ Add Media popup

Not entirely sure when this appeared in WordPress, I remember searching through the source code a while back to find a way to do this and it wasn’t available then. Anyway, WordPress now has a image_size_names_choose filter that allow you to show your custom image sizes in the Add Media popup. It is very handy if you’re building a website which requires additional sizes. Here’s how it’s done (put that in your functions.php file or…

Read More

Extended ASCII characters are valid php variable names

A curiosity… I was looking on the php.net website for what qualifies as a valid PHP class name, which they qualify as: A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. came across this statement Source PHP reference page But they then add the following: As a regular expression, it would be expressed thus: [a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff]* \x7f-\xff … really? (\x7f-\xff is the extended ascii character set)…

Read More