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
| SERVER = 'imap.gmail.com' | |
| USERNAME = 'XXX' | |
| PW = 'XXX' | |
| require 'net/imap' | |
| require 'net/smtp' | |
| require 'tmail' | |
| require 'maruku' | |
| def to_markdown(text) | |
| Maruku.new(text).to_html |
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
| web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb |
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
| rvm --create ree@benchmarks |
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
| # usage: | |
| # it "should return a result of 5" do | |
| # eventually { long_running_thing.result.should eq(5) } | |
| # end | |
| module AsyncHelper | |
| def eventually(:options = {}) | |
| timeout = options[:timeout] || 2 | |
| interval = options[:interval] || 0.1 | |
| time_limit = Time.now + timeout | |
| loop do |
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
| class StitchApplication | |
| def initialize | |
| @package = Stitch::Package.new(:paths => ["app/assets/javascripts/app", "app/assets/javascripts/lib"]) | |
| end | |
| def call(env) | |
| [200, {"Content-Type" => "text/javascript"}, [Uglifier.compile(@package.compile)]] | |
| end | |
| end |
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 'rubygems'; require 'active_resource'; require 'new_relic_api' | |
| servers = File.open("server_count.txt", "r").first.to_i | |
| instances_per_server = 6 | |
| cpu_burn_for_system = 1000.0 * 0.20 | |
| NewRelicApi.api_key = "<Your API Key>" | |
| account = NewRelicApi::Account.find(:first); | |
| application = account.applications[3]; |
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
| # with multiple collections + commands for renaming back the collections | |
| require 'mongo' | |
| # Stop writing to your database. | |
| # Then, for each collection: | |
| # Specify the DB and COLLECTION you want to convert. | |
| # Will insert all modified documents into a new collection | |
| # called 'new_' + old_collection_name. | |
| # Then you can delete the old collection and rename the new one |
NewerOlder