Skip to content

Instantly share code, notes, and snippets.

View roidrage's full-sized avatar
🌱
Planting seeds

Mathias Meyer roidrage

🌱
Planting seeds
View GitHub Profile
require 'connection_pool'
require 'redis'
require 'metriks'
class RedisClientWrapper
def initialize(options)
@options = options.delete(:pool)
@pool = ConnectionPool.new(@options) do
::Redis.new(options)
end
{:method=>:post, :body=>"{\"errors\":{\"request\":[\"Must contain a measurement\"]}}", :url=>#<URI::HTTPS:0x2c0a6125 URL:https://metrics-api.librato.com/v1/metrics>, :request_headers=>{"User-Agent"=>"librato-metrics/0.7.5 (jruby; 1.9.3p203; java) direct-faraday/0.8.1", "Content-Type"=>"application/json", "Authorization"=>""}, :parallel_manager=>nil, :request=>{:proxy=>nil}, :ssl=>{}, :request_body=>"{\"gauges\":[{\"source\":\"travis-ci-production\",\"measure_time\":1357630872,\"value\":24.776034,\"name\":\"v1.travis.time_since_last_build_started\"},{\"source\":\"travis-ci-production\",\"measure_time\":1357630872,\"value\":22.782136,\"name\":\"v1.travis.time_since_last_build_finished\"},{\"source\":\"travis-ci-production\",\"measure_time\":1357630872,\"value\":24,\"name\":\"v1.travis.rabbitmq.messages\"},{\"source\":\"travis-ci-production\",\"measure_time\":1357630872,\"value\":24,\"name\":\"v1.travis.rabbitmq.messages_unacked\"},{\"source\":\"travis-ci-production\",\"measure_time\":1357630872,\"value\":0,\"na
@roidrage
roidrage / index.js
Created December 17, 2012 16:18 — forked from aledbf/index.js
var program = require('commander'),
request = require('request'),
fs = require('fs'),
ursa = require('ursa');
program.on('--help', function() {
console.log(' Alternative to https://gist.github.com/fbb99b638e9da27fe24d (generate secure environment variables)');
console.log(' Example:');
console.log('');
console.log(' $ node index -r github-user/user-repo -v SECURE=value');
class Form
include ActiveModel::Validations
extend ActiveModel::Naming
def self.wraps(model)
@wraps = model
end
def self.model_name
ActiveModel::Name.new(@wraps.to_s.classify.constantize)
@roidrage
roidrage / .travis.yml
Created November 14, 2012 16:04
How to fix debugger gem woes with Ruby 1.9.3p327
bundler_args: --without debug
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/travis/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p327 provided with debugger-ruby_core_source gem.
**************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
160ml boiling water
25g coffee beans
lots of ice cubes
brew like a normal aeropress, press directly into a jug/glass/mug with ice cubes in it. add more ice cubes after the brew.
and done.
# jruby 1.6/1.7:
Timeout 2 triggered
# ruby 1.9.3-p194
Timeout 1 triggered
language: node_js
node_js:
- 0.6
- 0.8
- 0.9
matrix:
allow_failures:
- node_js: 0.9
notifications:
irc:
channels: "<grove_organization>.irc.grove.io#Channel"
nick: <grove_username>
password: <grove_organization>
nickserv_password: <grove_user_password>