Skip to main content

Posts

Showing posts from 2014

Opal - Ruby to JavaScript compiler

So I just found out about the Opal Ruby to JavaScript compiler and I am very intrigued. http://opalrb.org/ So for a few years now, the Ruby community has been encouraged to use CoffeeScript as a JavaScript "alternative" ( http://coffeescript.org/ ) but for some reason, as an avid JavaScript programmer, it never appealed to me. CoffeeScript offers a small amount of syntactic sugar on top of JavaScript, but it never seemed worth the learning curve for me to take it on. I don't actually mind JS's brackets (as they let you know where things begin and end cleanly) and significant white space in a programming language has always seemed like a bad idea too (it's bad enough that a misplaced semicolon can stop a program from running properly, but try searching for an extra white space character you can't even see!). Opal on the other hand, is actually Ruby compiled to JavaScript (not Ruby/Python-ish syntax). It looks, feels, and even smells like Ruby because it i

Checking performance in EaselJS apps

So one of the great things about EaselJS  is the fact that you can create Flash like games in JavaScript. I have been doing so on www.activememory.com for the last couple of years. Unfortunately, it came to our attention that on some systems, the games ran rather slowly. According to their own docs, they admit that the time between ticks might be greater than specified because of CPU load ( http://www.createjs.com/Docs/EaselJS/classes/Ticker.html#method_setInterval ). So, is there any way we can track the actual time between ticks on a real system? Fortunately, yes, we can. On each element that uses the ticker, you can set up an addEventListener and set the method you want to fire on that interval. createjs.Ticker.addEventListener('tick', tickListener); In the method itself you will want a few instance (or global) variables this.previousFrameTime this.totalFrames this.totalFrameTimes as well as a local variable currentFrameTime On each tick, we get the cu

Our git workflow

In my current gig in ABC Active Memory ( https://activememory.com/ ) we have put together a git workflow which works really well for us, so I decided I would write about it here so that others could benefit. The things you need to have in place though are Continuous Deployment ( http://en.wikipedia.org/wiki/Continuous_delivery ), Test Driven Development ( http://en.wikipedia.org/wiki/Test-driven_development ), Agile ( http://en.wikipedia.org/wiki/Agile_software_development ) and the desire to keep releasing small independent incremental features without any one of them blocking each other. Branches So the key is branches (obviously). We have 2 main branches which are shared by everyone, and every new feature takes place in a feature branch.  Our 2 shared branches are  acceptance master Feature branch When we start a new feature, we do all the work in our feature branch which we cut from  master . Our feature branches are named by ticket number (i.e. 575-add-invo