Showing posts from 2013

What's installed on my ec2

What's installed on my ec2? I swear between debian/ubuntu/mac os x/irix (well not anymore), I can never remember how to list installed packages on my ec2. 
Here is is:

sudo yum list installed
Plus or minus sudo depending on who you are. For once, the command is what i'd expect.


Toying around with backbone.js

Toying around with Backbone.js At $work, we've been using more and more backbone.js to create a more responsive front end experience and help the dev team manage the code.
I like backbone.js and find that its it is very helpful to seperate data and code on the client. But I've found that it challenges me to think in different ways.
I find it helpful to create an app so I did :)
Introducing Brewers Radio Finder Over the years, i've often driven between Milwaukee and St. Paul, MN. While on the drive, there are areas of the state where finding the close Brewer's radio station is tough and figuring out which station is the closest to you is difficult when looking at the map from Brewers Radio network. Am I currently closer to Reedsburg or Portage?
The app is pretty simple, you can type in or give it your current location and it will show the 3 closest Brewers radio stations to you. 
You can check it out at
If anyone is interested I&…

backbonejs' alteration of ajax handler parameters

As I spend time learning Backbone I've found some unexpected things (to me probably not to others). Today I found that even though Backbone fetch allows you to pass in typical jQuery ajax options (like success or error handlers), it will alter what parameters are passed back to those handlers.

In jQuery
Here is an example of plain jane ajax call (in older style jQuery before renaming of events):

In backbone handler In backbone fetch changes up what you receive. It is nicely stated in that section:
The options hash takes success and error callbacks which will both be passed (collection, response, options) as arguments. I only read that like 3 times before i actually saw that note :)

Here is an example of backbone success handler:

The one really nice part of the different parameters is that backbone gives you objects instead of raw-ish data. This means if you need to create two different models (or collections) from the same call, you can pass it directly into the model 'set…

Altering TT's INCLUDE_PATH in Dancer with Custom View

Altering Template Toolkit's INCLUDE_PATH in DancerThis just came up on Dancer's mailing list and I've been sitting on this code (and post) for a few months since the project I was working on didn't need it.Basically Dancer's Template Toolkit view requires you completely alter it or use the default setting. This is pain if you just want to add to it but not have to manage all the changes. I created a new TT view class, to get inside the TT init and add to the INCLUDE_PATH instead of replace it. The code was a bit involved and I extended it a bit by adding a customization flag in each environment (if needed).On to the codeHere is the code and config that i used to do this Disclaimer I don't recall all the other issues that i ran into while doing this. It was over 6 months ago but post questions if you have them__END__

Dancer + Nginx + FastCGI

Bring together the parts I was able to find complete documentation on running dancer with nginx using FastCGI. In the dancer deployment it discusses using Apache and fastcgi or nginx with proxy. Often, using nginx as proxy to starman(or some other plack webserver) is probably the right thing. But sometimes using fastcgi is good idea too :) I'm running some benchmarks but it seems like memory usage is a bit smaller with FCGI but I still need to do more digging on this.Make it soLets get all the parts install and then configure themInstall the PartsNote: These parts will be very dependent on your system. I'm assuming a debian/ubuntu system below. First you need to have nginx and dancer installed. For nginx i would recommend doing something like:apt-get install nginxor building and install from source.  Next, install need Perl modules:cpanm + Dancer's Makefile.PL I like to install using Dancer's app generated Makefile.PL along with cpanm to manage Perl dependencies.Setup …