Blog posts : "General"

Dependency management with CoffeeScript and Sprockets

Sprockets makes it really damn easy in a few lines of ruby to concatenate and serve your coffee script files. It supports multiple template engines ERB, JavaScript, CSS, SCSS, etc you can even add a dash of ERB <%= %> to your coffeescript source files by naming your file source.coffee.erb and sprock…

Read more

Stubbing out enumerable :each in Rspec

Ran into a tricky situation the other day trying mock out an enumerable object. I was trying to test a list of a files inside a Zip. However, I couldn't figure out how to yield a list of mocked ZipFile objects without monkey patching something inside Rubyzip which didn't seem very attractive at the …

Read more

ReviewBoard with Nginx

This weekend I decided to checkout ReviewBoard a slick Web 2.0 open source Django app for doing code reviews. Unfortunately, it took me quite a bit of time to set it up from scratch with Nginx. Thus, I decided to do a quick writeup for Nginx users.

ReviewBoard's setup docs is a good starting point …

Read more

Producer-consumer problem in C

For my Operating Systems class CSCI360 we had to write the classic Producer-consumer problem in C using semaphores. This is a classic problem/solution to preventing race conditions over a shared resource.  For those of you who don't know what a semaphore is it's simply a variable that acts as a coun…

Read more

Redis on Rails

Quite often I see users asking on #rubyonrails how to setup a persistent connection with redis + rails. It's actually quite simple and you can go about it several ways.  A common approach I see is to use the global variable $redis throughout your Rails application. If you're on Rails 3.0 the config/…

Read more

JSON to CSV Ruby Script

Spent a good 5 minutes trying to dig up a small JSON to CSV ruby script on google but couldn't find anything! So i wrote my own small script in Ruby. Hope this saves someone 5 minutes!

FORMAT

[{"first":"Richard", "last":"Ramsden"}, {"first":"Steven", "last":"Ramsden"}]

 

JSON to CSV

require 'json'…

Read more

Vancouver Island Spine Trail

I attended my first monthly meetup for Outdoor Vanisle this month at the Longwood Brewpub in Nanaimo. I was fortunate to catch a presentation on the proposed VI Spine trail setup by Gil Parker a member of the Vancouver Island Spine Association (VISTA). What is the VI Spine? It's a proposed 700km …

Read more

Priority Queue in PHP

 

Behold the Priority Queue / Minheap... In PHP! :D Stay tuned for the Ruby edition!

I couldn't find any decent implementations of the bottom-up heap so I wrote one myself!  I'm currently working on finding the quickest route between bus stops using Dijkstra's Algorithm which requires a priority qu…

Read more

Viunotes.com is live!

After a semester of development viunotes.com is now live! However, right now we're still in closed beta and working hard to improve the service.  Firstly, a big "thank you" to the hard effort of my teammates who made this possible: Ashavani Singla, Marcus English, and Simon Trigona.

I can't belie…

Read more

Zelda: Spirit Tracks

I haven't posted anything on my blog for awhile but with the holiday season coming to an end I had a chance to try out one of this years big hits for the Nintendo DS, Zelda: Spirit Tracks. The game has little choo choos! (a.k.a. trains) :D I know you must think its awesome already!

I haven' t been …

Read more

Ruby Game Programming II

(2.1) Introduction to Gosu

Now to kick part II off I've decided to switch from Zelda to a more traditional RPG game. It's your decision to choose what tileset/sprites suite your game needs. The only reason I decided to switch was because there's so many independent Zelda games out there that there'…

Read more

Ruby Game Programming I

Ruby Game Development with the Gosu Game Engine

Hello everyone,
I was bored one day so I decided to start a game development series using the programming language Ruby

Why Ruby?

Ruby has become a very popular programming language over the past few years. It's a wonderful language for hacking, d…

Read more

12 blog posts