TC Disrupt NY Hackathon yr 4, postmortem

30 Apr 2013 - Matthew Jording

This weekend the 4th New York TechCrunch Disrupt conference is happening. Every year Disrupt is proceeded by a 24 hour hack-a-thon, and as with every year before I rallied friends & colleagues to go without sleep and produce questionable code in challenging environments.

The hack-a-thon is startup bootstraping accelerated. Finding collaborators, discovering market, communicating vision, and where I generally land, engineering a solution.

The full reveal is going to come in a couple of posts after a full assessment of technical debt.

no spoon

Rails 4

28 Apr 2013 - Matthew Jording

Rails 4, is on deck. Is your application ready for it?

Big changes afoot. Good ones for the most part.

  • Rails 4 requires Ruby >= 1.9.3

The biggest change will be the deprecation of Ruby 1.8.x support. You will have to set your environment to 1.9.3 or above.

This means not only ensuring your hosting enviornment (heroku, engineyard, etc) are up to date, but also that your development environment matches.

In terminal check the version of your installed ruby ruby –version You should see ruby-1.9.3-p392 Or if your living on the edge

ruby 2.0.0p0

  • Rails 4 is Threadsafe by default.

    Rails threadsafe! before 4 was an option but now its default.

    Threadsafe Rails

    • Preloads the application setting preload_frameworks, cache_classes, and dependency_loading to true

    • Stop locking allow_concurrency is set to true. This will turn of the rack middleware Rack::Lock. Which will run requests asynchronously.

      Unicorn is a concurrent server. Concurrency accepts multiple requests at a time, distributing the request through workers. In fact in some modified configurations of unicorn benchmarks show better performance then the argued winner of the concurrency arguement nodejs.

      Writing threadsafe code is not as hard as the Java developer drenched in sweat makes it out to be.

require 'thread'
semaphore = Mutex.new

a = Thread.new {
    semaphore.synchronize {
        # access shared resource
    }
}

b = Thread.new {
    semaphore.synchronize {
        # access shared resource
    }
}

Emberjs

20 Apr 2013 - Matthew Jording