Budgetary Details

Out of curiosity today I decided to look up some information about Canada’s federal deficit (read: how many fucking dollars is it?). I wasn’t sure whether to believe this site or not — its almost sappy, pleading tone (especially the video) didn’t strike me as very genuine — and wouldn’t you know it, it’s pretty damn accurate.

I discovered this elusive number buried in a boring and forgettable chart, a mere 3500 words (give or take) into Chapter 5 of the budget. That’s right. Our federal debt is known to be somewhere in the range of $556 bllion and $586 billion. According to the national debt clock linked above, we’re at $563 billion right now. This number (along with its increasing forecasts) is mentioned nowhere else in the entire document, because who cares right?

Posted in Politics, Rants | Tagged | 1 Comment

Javascript and CSS compression in CakePHP

Just a quick note for all of those looking to optimize their JS/CSS in CakePHP. The awesome Matt Curry put together a CakePHP plugin which makes this incredibly easy. Here is his Asset plugin on Github.

It works almost perfectly right out of the box but I ran into a small problem when setting it up on one of my sites. The Javascript component of TinyMCE does not play well with JSMin and is rendered useless when you run it through Asset.

Unfortunately, I load the TinyMCE scripts within my view but they need to appear within the <head> tag. Because Asset filters all scripts that are passed through the Javascript Helper with the inline => false parameter, there was no avoiding it. I ended up hacking away at the plugin a bit to add a Configure option which lets you specify files to output directly (and not compress/combine with the rest). Check out my fork of mcurry’s asset on Github.

It’s a small hack that should rarely need to be used, and be aware that using it will likely mess up the order of your JS. If the order in which your scripts are output is important, than it might not work for you. Usage is quite simple and is explained in the README.

Questions and comments are welcome!

Posted in Development | Tagged , , | Leave a comment

A Practical Guide to using PGP in Ubuntu Karmic Koala

As more and more of our data is stored and/or communicated digitally it’s becoming increasingly important for everyone to be aware of their privacy and security. Even though you might think nobody else could possibly be interested in your data, it doesn’t hurt to take some steps to educate yourself on how to protect your data online.

Encryption is one option to protect your data and using it can be quite straightforward. You may rarely or never come across a situation where you’d need to encrypt a message or file but it might happen and being prepared is always good. Besides that, I’m a bit of a nerd and I find this kind of thing fascinating and if you’re reading this then chances are you do too.

This post should serve as a quick-and-dirty primer, so I won’t be delving into too much detail, but for those who are interested I’ll leave you with some links at the bottom of the page. For those of you still stuck with Microsoft, I’m working on a Windows version of this guide – stay posted!

Continue reading

Posted in Technology | Tagged , , , , , , | Leave a comment

CakePHP Paginator URLs and POST forms

There’s a quote that you often see in the #cakephp channel on irc.freenode.net and it goes something like, “If something is hard in CakePHP, then you’re doing it wrong”. This is proven to me over and over the more comfortable I get with CakePHP. One of the most annoying problems I had as a Cake newbie was a pretty common scenario:

I’m using Cake’s Paginator component and helper to paginate results from my profiles table. Here, sweet Jesus, is a perfect example of why I love Cake! Pagination used to be such a pain in the ass! Now that I’ve got that working I need to set up some forms so that the results can be filtered. So I write up my filter criteria form using the Form helper (*squeal* *gush*). Say I want a filter on the ‘city’ and ‘name’ fields. Also, because I want to be able to bookmark these customized results, I’m going to use the get method for my form. I set my controller action to parse the form input as usual ($this->data).

Everything looks good to me at this point so I submit the form. Ok, it works. But the URL looks like /profiles/search?name=joe&city=toronto, which looks kinda ugly. Oh, and crap, now my pagination is broken. At this point I come up with various hacks that sorta work, but they’re all terrible. Maybe I’ll rewrite some portions of the Paginator helper, or create my own version because holy shit how did these Cake guys make such a glaring mistake! The stupid Paginator helper uses named parameters but I need to submit my form via get so that I can bookmark the results! Come to think of it, what the hell are these named parameters good for in the first place? Much frustration ensues.

Continue reading

Posted in Development | Tagged , , , , , | 6 Comments

How To Enable Half-Star Ratings in iTunes

I have such a large collection of music that 5 stars doesn’t really give me the kind of granularity that I need to rate my music, so I started looking to see if there was a way to tweak that number. I came across this Lifehacker article which explained how to do it on a Mac, but that didn’t help me because my desktop runs Windows Vista (groan). After some more poking around I came across this helpful post and it worked perfectly.

Continue reading

Posted in Music, Tutorials | Tagged , , | 3 Comments