- Introduction
- Definition
- Examples
- Links
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Provide data over STDIN to Instrumental | |
| # Format of data: | |
| # <metric name> <value> <unix timestamp> | |
| # or | |
| # <metric name> <value> | |
| # | |
| # Second form will assume that the time the | |
| # metric is reported is when the event occurred. | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'integration_helper' | |
| require 'rack' | |
| require 'rack/handler/webrick' | |
| describe HttpClient do | |
| before :all do | |
| @server = WEBrick::HTTPServer.new( | |
| :Port => 9293, | |
| :Logger => Rails.logger, | |
| :AccessLog => Rails.logger |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra' | |
| require 'redis' | |
| require 'json' | |
| require 'date' | |
| class String | |
| def &(str) | |
| result = '' | |
| result.force_encoding("BINARY") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # by Eric Lindvall <[email protected]> | |
| # | |
| class LruGenerationalHash | |
| attr_reader :max_size | |
| def initialize(max_size, generations = 2) | |
| @generations = generations.times.collect { Hash.new } | |
| @max_size = max_size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe LeadService do | |
| LeadService.configure(:test) do | |
| before { settings.set(:instance, self) } | |
| end | |
| # Required for Rack::Test | |
| # | |
| def app | |
| LeadService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'em-http' | |
| EM.run do | |
| def dispatch(uri, retries = 0) | |
| h = EM::HttpRequest.new(uri).get | |
| h.callback { |rep| [:success, rep.response]; EM.stop } | |
| h.errback do |rep| | |
| p [:fail, rep] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source :gemcutter | |
| gem 'goliath', :git => 'git://github.com/postrank-labs/goliath.git' | |
| gem 'em-synchrony', :git => 'git://github.com/igrigorik/em-synchrony.git' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
| 1.) Open any application | |
| 2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
| 3.) Release Power button | |
| 4.) Press and hold Home button Lightly | |
| until screen returns to icon screen |