This code is no longer needed. Heroku has provided syslog drains for all users for free.
For better Heroku logging with Papertrail, check this out:
http://help.papertrailapp.com/kb/hosting-services/heroku#standalone
| #!/usr/bin/env ruby | |
| require 'ftools' | |
| require 'fileutils' | |
| require 'rubygems' | |
| require 'RMagick' | |
| include Magick | |
| require 'open3' | |
| def merge( files = [] ) |
| // browser history with HTML5 support | |
| (function() { | |
| var loc = window.location, | |
| pushSupport = !!(window.history && window.history.pushState), | |
| hashStrip = /^#*/; | |
| // add HTML5 support to Backbone.history, drop the old IE stuff | |
| _.extend(Backbone.History.prototype, { | |
| getFragment : function(l) { |
| # This is just an hint for a simple Redis caching "framework" using Sinatra | |
| # A friend of mine asked for something like that, after checking the first two gems realized there was | |
| # a lot of useless complexity (IMHO). That's the result. | |
| # | |
| # The use_cache parameter is useful if you want to cache only if the user is authenticated or | |
| # something like that, so you can do cache_url(ttl,User.logged_in?, ...) | |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'redis' |
This code is no longer needed. Heroku has provided syslog drains for all users for free.
For better Heroku logging with Papertrail, check this out:
http://help.papertrailapp.com/kb/hosting-services/heroku#standalone
| #!/usr/bin/env sh | |
| # Title: Ruby development environment for OS X (Lion) | |
| # Author: Rogelio J. Samour | |
| # Warning: | |
| # While it is unlikely any code below might damage your system, | |
| # it’s always a good idea to back up everything that matters to you | |
| # before running this script! Just in case. I am not responsible for | |
| # anything that may result from running this script. Proceed at | |
| # your own risk. |
Fibur is a library that allows concurrency during Ruby I/O operations without needing to make use of callback systems. Traditionally in Ruby, to achieve concurrency during blocking I/O operations, programmers would make use of Fibers and callbacks. Fibur eliminates the need for wrapping your I/O calls with Fibers and a callback. It allows you to write your blocking I/O calls the way you normally would, and still have concurrent execution during those I/O calls.
Say you have a method that fetches data from a network resource:
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.
Eventually platforms outgrow the single-source-tree model and become distributed systems. A common pattern in these distributed systems is distributed composition via event buffering. Here we motivate and describe this event buffering pattern.
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |
| # A class-based template for jQuery plugins in Coffeescript | |
| # | |
| # $('.target').myPlugin({ paramA: 'not-foo' }); | |
| # $('.target').myPlugin('myMethod', 'Hello, world'); | |
| # | |
| # Check out Alan Hogan's original jQuery plugin template: | |
| # https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template | |
| # | |
| (($, window) -> |