Skip to content

Instantly share code, notes, and snippets.

Teacup::Stylesheet.new :root_style do
style :label,
text: "Label",
backgroundColor: :gray,
font: :bold.uifont(15),
textColor: :white,
shadowColor: :black,
textAlignment: :right,
layer: {

With Heroku's new JRuby support you may have already seen that you can run TorqueBox Lite on Heroku. But, that only gives you the web features of TorqueBox. What about scheduled jobs, backgroundable, messaging, services, and caching?

With a small amount of extra work, you can now run the full TorqueBox (minus STOMP support and clustering) on Heroku as well! I've successfully deployed several test applications, including the example Rails application from our Getting Started Guide which has a scheduled job, a service, and uses backgroundable and messaging.

The version of TorqueBox you'll be running on Heroku is almost identical (two commits newer) than TorqueBox 2.2.0. We had to expose a small extra flag to control when TorqueBox actually binds to the HTTP port since Heroku uses that as the trigger that your application is up and ready to serve reque

@mattsgarrison
mattsgarrison / dump.m
Created June 12, 2012 03:12 — forked from gavingmiller/dump.m
Objective-C Dump Views
static void dumpViews(UIView* view, NSString *text, NSString *indent)
{
Class cl = [view class];
NSString *classDescription = [cl description];
while ([cl superclass])
{
cl = [cl superclass];
classDescription = [classDescription stringByAppendingFormat:@":%@", [cl description]];
}
@mattsgarrison
mattsgarrison / date_time.coffee
Created December 28, 2011 16:07 — forked from markbates/date_time.coffee
Example: Rails-style date/time helpers in CoffeeScript (added days)
Number::seconds = ->
@ * 1000
Number::minutes = ->
@seconds() * 60
Number::minute = Number::minutes
Number::hours = ->
@minutes() * 60
@mattsgarrison
mattsgarrison / autodj.bookmarklet.js
Created August 23, 2011 20:02 — forked from azoff/autodj.bookmarklet.js
Turntable.fm DJ Script
javascript:(function(g,d,f){if(f)d.info("Session found:",f);else return d.warn("No session found!");var h={check:10,wait:500},b=g.autodj={api:g[f],available:function(a){return b.api.taken_dj_map[a]<0},spot:function(){return b.api.become_dj.data("spot")},become:function(a){b.api.callback("become_dj",a)},waiter:function(a){return function(){return b.available(a)?(b.become(a),a):(d.info("Waiting..."),-1)}},seated:function(a){return b.api.djs[a]&&b.api.djs[a][0]===b.api.myuserid},wait:function(a,c){var e=c!==void 0,
a=a||h.check,c=c||b.spot();b.seated(c)?d.warn("Spot",c,"taken!"):(e&&d.error("Spot",c,"missed. Restarting..."),d.info("Polling @",a,"ms"),b.check(a,b.waiter(c)))},check:function(a,c){setTimeout(function(){var e=c.call(b);e>0?(d.warn("Spot",e,"open..."),setTimeout(function(){b.wait(a,e)},h.wait)):b.check(a,c)},a)}}})(window,console,function(g,d,f,h,b,a,c,e,i,j,k){try{return g(d)[f](h)[b][a][c][e]()[i](j)[k]}catch(l){return null}}(jQuery,".invite_dj","data","events","click",0,"handler","toString","match