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
| # because queue_classic requires DATABASE_URL in test and development | |
| ENV["DATABASE_URL"] ||= begin | |
| config = YAML.load(ERB.new(IO.read(Rails.root.join("config/database.yml"))).result)[Rails.env] | |
| "#{config["adapter"]}://#{config["username"]}:@#{config["host"]}/#{config["database"]}" | |
| 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
| def run_queued_jobs | |
| worker = QC::Worker.new | |
| worker.work until QC.count.zero? | |
| 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
| ActiveRecord::Base.after_create do |record| | |
| INSTRUMENTAL.increment "#{record.class.to_s.underscore}.create" | |
| 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
| vim /etc/statsd/config.js | |
| add console backend: | |
| "backends": [ | |
| "./backends/graphite", | |
| "./backends/console", | |
| "statsd-librato-backend" | |
| ], | |
| restart statsd |
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
| LEFTRONIC = Leftronic.new 'leftronic key' | |
| class Worker | |
| def self.five_second_job | |
| LEFTRONIC.push_number 'widget id', rand | |
| end | |
| end | |
| include Clockwork | |
| handler { |job| Worker.send(job) } |
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
| javascript:$("#web-nag").hide() |
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 HerokuHeaders | |
| def self.call(env) | |
| $statsd.gauge('heroku.dynos_in_use', env['HTTP_X_HEROKU_DYNOS_IN_USE']) | |
| $statsd.timing('heroku.queue_wait_time', env['HTTP_X_HEROKU_QUEUE_WAIT_TIME']) | |
| $statsd.gauge('heroku.queue_depth', env['HTTP_X_HEROKU_QUEUE_DEPTH']) | |
| [404, {}, []] | |
| 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.example.ssh-tunnel</string> | |
| <key>OnDemand</key> | |
| <false/> | |
| <key>ProgramArguments</key> | |
| <array> |
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
| # http://www.obdev.at/resources/launchbar/help/URLCommands.html | |
| x-launchbar:execute?path=/usr/local/bin/rbenv&arguments=exec+milkmaid+task+add+%22*%22 |
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
| exports.init = function(startup_time, config, events) { | |
| events.on('flush', function(timestamp, metrics) { | |
| console.log(JSON.stringify(timestamp)); | |
| console.log(JSON.stringify(metrics)); | |
| }); | |
| return true; | |
| }; |