The folks at Epipheo Studios have given us all a wonder gift. Their video How To Survive A Robot Uprising (aka Robopocalypse) is a clever, fun, and informative look how how to spot, and defend yourself against killer robots (spoiler: look for red glowing eyes!).
Over the last few weeks (months) I rebuilt DerekAllard.com with a new look/feel. Still a few rough edges here and there (if you see anything, please contact me) but I wanted to push it out now :)

When spammers do sneak comments through my blog, I have a very simple one click* snippet to ban them similar to the way the EE forum’s “ban member” option works. Essentially, beside every comment, I have a “delete & ban” link. This saves me needing to fire up my control panel, and navigate to the proper place. It just saves a bit of clicking around.
I never thought much of it, but yesterday it co-incidentally came up when I showed another EE dev my site’s control panel for something totally unrelated. Since I implement the “one click delete” in a snippet, I thought I’d share it here:
{if can_moderate_comment}
[ <a href="{cp_url}?S=0&D=cp&C=addons_modules&M=show_module_cp&module=comment&method=index&entry_id={entry_id}">delete & ban</a> ]
{/if}
And then in my template
{exp:comment:entries}
<p>{url_as_author} wrote: {ban_member_snippet}</p>
{comment}
{/exp:comment:entries}
I’ve used this sucker for so long I forgot all about it. If you have any “go to” snippets, code or tricks, please post them in the comments here!
* Technically its probably 2 or 3 clicks :)
I doubt {Less} is much of a revenlation revelation to anyone nerdy enough to be reading my site, so I’ll skip the usual platitudes and jump right into why I’m writing this.
As part of a recent site build, I’ve been relying heavily on CSS3 features, many of which are only partially implemented across the browsers. Not a big deal for me, it just means a lot of vendor prefixes:
#someElement {
-webkit-transition: all .5s;
-moz-transition: all .5s;
-o-transition: all .5s;
transition: all .5s;
}
But I have a few problems with this (CSS validation and older Internet Explorer are not among them). Firstly, its a pain to need to add that 4 lines every time, and secondly, one day I’ll want to remove some or all of the vendor prefixes and I’ll need to do it a bunch of times.
As a devoted {Less} user, the answer seemed obvious at first, I’ll just throw in a mixin to reduce it down into one simple line.
#someElement {
.transition(all, .5s);
}
I’m hardly the first person to come up with this idea, but looking around for other .less files that handled vendor prefixes the way I wanted, with all the CSS3 items I wanted, was challenging. So I cobbled together my own file.
You can grab it off Github if that’s your sort of thing LESSCSS mixins file of vendor prefixes for CSS3.
During a recent ExpressionEngine site build, I found myself stuck for a few days trying to get cookies to work in Safari. Since actually logging in wasn’t particularly important to the site, I poked away at it a little bit here… a little bit there… but never actually solved it over the course of 3 days. A quick Google for the problem (EE forum search is darn near useless these days) brought me to Safari, cookies, and lost time from Fred of the fine folks at ngen works. So I fired out
echo date('c');
// I'll get you kids and your darn dog too!!!
And lo and behold, the server clock was off! A quick support email later, things are humming along tickity-boo, so I’m writing this partially as a “note to self”, and partially to add my voice to the stream of knowledge that is the web.
Preamble: I’m a huge fan of Alfred App. This post isn’t about Alfred per se, but if you’re a Mac user, do yourself a favour and grab a copy. There’s a free version, and the “powerpack”. The powerpack is what is needed to follow the rest of this post.
Recently I’ve been tackling a lot of projects where the state of the app when “logged in” was different then if you were “logged out”. In order to test the app in both phases, I spent a lot of time flipping between staying logged in, and also launching the site in private mode (or in Chrome, “Incognito”). To help speed up the process, I wrote a few extensions for Alfred to automatically launch my browsers in private mode.
The extensions support Firefox, Chrome, Safari and Opera.
Here’s what you’ll see now:
Grab the extensions and play around: alfred_private_mode_extensions.zip. Installing them is super easy, open Alfred’s preferences > extensions, and just drop them one at a time onto the “Drop to Install” box.
I’ve had a chance to be involved in some some pretty fun and exciting ExpressionEngine projects lately. Often, this means looking through sites that other developers had originally built out. Its always fun seeing how other smart people choose to solve a problem - often in a different way then I’d do it. Reading other people’s code is always a great way to learn.
That said, a recurring theme I see are poorly optimized EE templates. Usually, there are minor changes I can have a dramatic impact. The most common minor fix is simply understanding the difference between “simple” and “complex” conditionals. While digging around for a few good resources I could use to help explain it, I stumbled across a wonderful post on the EE forums by John D Wells that explains it masterfully, which I’m reposting here with his permission for my convenience. As an aside, John is a pretty prolific guy, and if you aren’t subscribed to his blog, now is a good time to check it out.
I mentioned on Twitter that I’m impressed so far with Firefox 4. Here’s a very minor, change I’ve noticed, that I’m a fan of; the treatment of javascript terminal dialogs.
The overlay makes it clear to the user that they need to interact with the alert box before they can use the page. Much nicer than the old style, where the page remained unaltered and the alert dropped from the top (at least on a Mac, I understand Windows versions appeared mid-screen).
There’s still some room for improvement here, and I don’t think this style of modal will (or even should) replace current solutions for modal windows, but I like how the Mozilla team is working to draw more attention to the box.
That said, I hope the Firefox team doesn’t give in to the inevitable cries from either the “we hate any and all change” camp, or the “now I want to use an image as the overlay and control the opacity” camp.
Every time I start a new project with CodeIgniter I find myself tasked with something, often a small thing, that I’ve never “solved” before. I try to use these moments as opportunities to explore PHP and CodeIgniter a little bit deeper. Often times I surprise myself by learning something new, or surprise myself at having forgotten something relatively “basic”. Here are 5 things I’ve discovered or rediscovered in the last few years. If you’re a CI veteran, some of these will be old news to you, and some might be new. Maybe just like me you’ve forgotten about a handy trick. Regardless, they’ve become mainstays in my coding now, and I think they deserve a bit more recognition.
Keep reading to see the tips!
A project I’m working on needs a monthly calendar. Naturally, I’m using CodeIgniter as the base of it. Here’s the default CI-based calendar:

and here’s what I ended at (you can grab the files (CSS, config file, sample controller/view) below).
