DerekAllard.com

Launching your browsers in Private Mode with Alfred 2

Alfred AppPreamble: 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.

Years ago I wrote Launching your browsers in Private Mode with Alfred as a quick little Alfred extension. I was recently asked if I’d updated the extension for Alfred 2. Sadly, I had not, but a quick search showed that someone else had already done the grunt work on the Alfred forums, which I’ve backed up here (you may need to right-click ‘save link as’) to ensure the workflow will always be available.

 

 

Understand the Favicon

Jonathan T. Neal has written what is probably the single greatest discussion around the topic of favicons I’ve ever read with Understand the Favicon.

The favicon on DerekAllard.com

The level of research is wonderful, including breakdowns of browser weaknesses and quirks (still looking at your Internet Explorer). Of particular note is how different browsers handle pages that offer both png and ico formatted favicons, including this gem:

Opera, not wanting to take sides, will choose from any of the available icons at complete random. I love that Opera does this.

A highly informative read.

While we’re talking about favicons, I recently used the wonderful “Tinycon” library from Tom Moor, and was really happy with the results. Check it out if you need a small library for manipulating the favicon.

Launching your browsers in Private Mode with Alfred

Alfred AppPreamble: 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.

Modifying the default CodeIgniter Calendar template for fun and profit

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:

default CI calendar

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

completed CodeIgniter monthly calendar

 

Opening Firefox tabs at the end of the tab row

Firefox 3.6 was released today. I love it. Love it. One thing I wasn’t crazy about was a behaviour change when opening links in new tabs. Before 3.6, they opened at the end of the tab row, but now they open beside the tab you are currently on. Want to change it back?

browser.tabs.insertRelatedAfterCurrent

Enjoy!

Getting the value of a selected radio button out of a radio group in jQuery

Just a quick tip, I needed to get the value of the selected radio button from a radio group using jQuery. While several custom selectors are available for forms, there isn’t a simple way to do it that I could find. I ended up using a solution that I quite like, and wanted to share.

$("input[name=radio_group]:checked").val(); 

Have I mentioned that I love jQuery?

Edit: This entry was directly attacked by the robots, and all comments were lost. Please leave one again if you left it earlier, and accept my sincerest of apologies.

 

PHP if statement explained with Robots and James Brown’s Sex Machine

George Ornbo over at ShapeShed (an EE shop, go admire the majesty) wrote a cute introduction to the PHP "if" statment. If you can't have fun with your code... well, then you just plain can't have fun.

I get a fair few requests from designers asking for help with basic PHP. So I'm going to write a series on very basic PHP. It is not hard so let's start with a robot and the if statement.

Not normally worthy of a mention, but he uses robots to explain, and everyone knows I'm a fool for robots; but also offers this masterful bit of PHP code (slightly altered, for brevity).

if ($button == "pressed"{
    
echo "I am alive and will now perform Sex Machine by James Brown";
}
else {
    
echo "Malfunction! Broken, destroyed, smashed.";

Why do I get the sense that this title is going to get me banned from Google?

Adding time to jQuery UI Datepicker

For some work I’m doing right now I needed the current time output into the input field that the (excellent) jQuery datepicker uses, but I don’t need it selectable by the user.  The default format is

mm/dd/yyyy 

but can be formatted using the formatDate parameter.  The list of formatting options is considerable, including predefined setups for ATOM, COOKIE, ISO_8601, various RFC dates, RSS, TIMESTAMP and even W3C.  Unfortunately none of the predefined formats, nor the large list of date components includes time.

Read on for my solution to this dilemna.
jQuery datepicker

Turning off smileys in iChat 4

Instant message has become a part of my daily life.  I use it pretty much non stop for work, and my work involves writing a lot of code.  It isn’t uncommon for me to send something like

if ($a=($b+$c)) 

I like iChat (Adium of course is the old favourite, but hasn’t been used much since I moved to Leopard and Apple improved iChat so much), but sometimes it’s too cute for its own good.  This is especially true of the “helpful” way it converts :) and ;) into :) and ;) respectively. Helpful in the same way that Clippy was helpful.

This behaviour gets very annoying when one is trying to look at code.  The above code example becomes if ($a=($b+$c)).  You can image how annoying this is when every third line of chat is code.  So I went hunting through the iChat preferences to find a little box I could uncheck and turn off smileys, only there was no box to be found.

A quick trip through google didn’t turn up too much either, but I was able to figure out where iChat kept its preferences for that.  A minute later, I had figured out a way to turn them off.  Here’s how:

Browse to /Applications/iChat.app, and “Show Package Contents”.
Show Package Contents

Next up, browse into Contents/Resources/English.lproj and look for a file called SmileyTable.plist.  This is where all the smiley definitions are stored.  Without it, iChat can’t translate smiles, so rename it to “SmileyTable.plist.banished”.  If you ever want smileys back, just reverse the process!

code with no smiles in it

There, that feels better ;)

failed screencast

So, I just spent the last hour getting a screencast built to show how you can start using ExpressionEngine on your site now, even if you don’t “know” ExpressinEngine yet.  Good times.  Used Screenflow, had a sexy little video thing going… and then realized that I recorded the blasted thing nearly fullscreen on my computer (it’s a 24inch iMac).  I tried to scale it down so that it would fit onto 1 screen for most people, but then so much detail got lost that it looked like crap.

How frustrating.

So I’ll re-build it at some point in the near future, and for now, you can admire all my hard work in static, useless, image form ;)

the screencast in screenflow