Rails + Webpacker Deployments on Heroku

A few weeks ago I decided to take the leap and implement Webpacker into an existing Rails project. Initially this seemed like a great idea and almost too easy thanks to the rails/webpacker project. After a couple of hours I had everything working and some existing React components migrated from a custom compile system to the asset pipeline. Deploying to staging had a few minor hiccups, but nothing major and the project was ready for sign-off and production release.

Model Errors in EmberJS

Today, I spent longer than I feel comfortable admitting solving a supposedly simple problem in my EmberJS application. Since this particular issue was so frustrating and undocumented I'm going to share my experiences in case someone else comes across the same hair-pulling nightmare in the future.

Free Hosting with Github Pages

I've been meaning to try out Github Pages for quite a while, but never had a project that was suitable as nearly all of my work is built on a custom back end server. I also wanted to get a few old projects online to share the code so people can maybe do something cool with it.

It's September already?

Where has the time gone! I've been working at my new job for almost a whole month now and it still feels like I've just started! For those of you that don't know I'm now a programmer at Performance Horizon which is pretty awesome; quite the change from flash gaming! It's also the main reason I've been neglecting my personal projects and blog updates to concentrate all the cool things I've been working on.

Google Code Prettify

I've updated my Blog to support Google Code Prettify since I'm going to be posting a lot more coding and example posts.

How to Rename a Field in MongoDB

Since MongoDB is technically a schema-less database, there aren't fields or columns that you are used to in things such as MySQL, and certainly no decent applications for managing data easily. Luckily, MongoDB has a lovely command shell which can be queried using simple JavaScript. The below command will rename a field, if you named it wrong in an initial stage of your app, like I've done a few times while learning. db.post.update({}, { $rename: {"old_name": "new_name"}}, false, true); The first parameter is your standard query, which I've left blank to match all documents by default. Please note that the 3rd and fourth paramters are actually required, or this won't work as by default only one document will be matched and an upsert will be applied, which isn't what you want in this situation. You can find the full documentation and explanation of the update function and the $rename command over at http://www.mongodb.org/display/DOCS/Updating#Updating-%24rename

JavaScript Racing Game Prototype

I've just finished working on the first prototype for my up and coming racing engine written in JavaScript. It's nowhere near finished, but it gets the simple concept across of where this could be taken. Right now it's not a game at all, it's simply an engine which can be used to make a game. I wrote a basic one track map, with dumb AI cars and a player controlled car to show some of the functionality. Please excuse the bad graphics, I will be improving them later as the project develops.

Pixel Perfect Collision Detection in JavaScript

I'm working on a simple game to refresh my canvas knowledge. I decided to built the game entirly in JavaScript, which isn't easy to do due to the fact it isn't designed for that purpose. There are no nice little helpers like drawing, object rendering, and most importantly collision detection. I've decided it would probably be easier to use an engine, but since you all know I hate using libraries or engines unless really necessary, I've decided to go about doing all of the code entirely myself from scratch. After a bit of playing around, and some memories from maths lessons in school I figured out how to do collision detection in raw JavaScript code, which I'm going to share with you