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
@roidrage
roidrage / chunk.js
Created March 29, 2011 08:19
chunk.js
function chunk(a, s){
for(var x, i = 0, c = -1, l = a.length, n = []; i < l; i++)
(x = i % s) ? n[c][x] = a[i] : n[++c] = [a[i]];
return n;
}
  • Turn The Ship Around
  • Five Dysfunctions of a Team
  • Leading Snowflakes
  • High-Output Management
  • Slack: Getting Past Burnout
  • The Year Without Pants
  • Creativity, Inc.
  • Start With Why
  • Crucial Conversations
  • Drive: The Surprising Truth About What Motivates Us
@roidrage
roidrage / .travis.yml
Created July 9, 2015 09:07
MongoDB on Travis CI's container setup
sudo: false
env:
global:
- MONGODB_VERSION=2.6.10
install:
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-$MONGODB_VERSION.tgz
- tar xfz mongodb-linux-x86_64-$MONGODB_VERSION.tgz
- export PATH=`pwd`/mongodb-linux-x86_64-$MONGODB_VERSION/bin:$PATH
- mkdir -p data/db
- mongod --dbpath=data/db &
@roidrage
roidrage / meatballs.md
Last active December 5, 2019 22:44
Americanized version of my meatballs recipe

The @roidrage meatballs extravaganza.

The secret ingredient to this recipe is letting everything stew for a few hours. First the tomato sauce, requires at least 90 minutes to 2 hours. Then the meatballs in the sauce another 90 minutes. The longer the better.

Once the meatballs are in the sauce, the more time you give them, the more delicious flavor will seep from the meat into the sauce, and vice versa. I'd recommend giving it a total of four hours for maximum taste extraction.

The long stew ensure that the fluids have evaporated and that you're left with the tastiest meatballs you've ever had.

Ingredients (serves four hungry people):

@roidrage
roidrage / oauth.coffee
Created May 23, 2011 08:21
Example of using Express and node-oauth to do OAuth with Twitter
express = require "express"
sys = require "sys"
util = require "util"
oauth = require "oauth"
fs = require "fs"
app = module.exports = express.createServer()
app.configure('development', () ->
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }))
@roidrage
roidrage / wrap.rb
Last active May 3, 2018 04:46
A simple wrapper that forks off a child and prints out a progress dot every X seconds
#!/usr/bin/env ruby
pid = Kernel.fork do
`#{ARGV.join(" ")}`
exit
end
trap(:CHLD) do
print "\n"
exit
@roidrage
roidrage / mantras.md
Created April 21, 2011 16:18
7 Mantras of Successful Infrastructure
  • The network is reliable.
  • Latency is zero.
  • Bandwidth is infinite.
  • The network is secure.
  • Topology doesn't change.
  • There is one administrator.
  • Transport cost is zero.
  • The network is homogeneous.
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
@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
{
"id": 1,
"number": "1",
"status": null,
"started_at": null,
"finished_at": null,
"status_message": "Passed",
"commit": "62aae5f70ceee39123ef",
"branch": "master",
"message": "the commit message",