Tag web

Add days, weeks, months etc to dates in PHP

As you probably know php gives you a nice date() function that allows you to get a date and format it using a vast amount of unix date strings. But what if you want to add/subtract days, weeks and months to a date? Marty, warm up the delorean…

Removing empty lines with preg_replace

Just a quick post today to mention something that will come in useful if you need to parse or handle large amounts of text and whitespace.

Joomla - Modules within modules

Today I discovered that Joomla modules can act like russian dolls! In that if the mood takes you, it is entirely possible to load and render a module inside another module.

Fixing Google Chrome fonts in Mac OS X

Today my install of Google Chrome went a little mad and decided that Times New Roman was the best font in the world and should have the whole internet rendered in it. To fix this I had to clear OS X’s font caches using the following commands: sudo atsutil databases -remove atsutil server -shutdown atsutil server -ping And there was much rejoicing…

Reset Auto Increment with MySQL

Alot of the time when you are working with MySQL you will need a table that has an auto incrementing id field. This is great and usually doesn’t pose you any problems, but i’ve noticed that if you are deleting rows manually alot (as you will during development), then it can get a little confused.