Skip to content

Instantly share code, notes, and snippets.

View delano's full-sized avatar
👋
Let's talk about building teams

Delano delano

👋
Let's talk about building teams
View GitHub Profile
@delano
delano / gist:180
Created July 21, 2008 20:45 — forked from dfischer/gist:170
undefined
This is so fucking awesome!
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'dm-validations'
require 'dm-timestamps'
require 'syntaxi'
DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/toopaste.sqlite3")
# where args is a hash of URI parameters
def initialize(args = {})
unless args.empty?
# I want to avoid doing this
#self.title = args[:title]
#self.uri = args[:uri]
# and check the parameters names dynamically
args.each do |n,v|
# uri_params
#
# Turn URI parameters like uri[0], uri[1]... into an array of values
# and ones like account[id], account[name]... into a hash
# This needs to be called inside of a "post" or "get" command. It doesn't work when placed inside the "before" (?)
def uri_params_fix!
p = params
p.each_pair do |key_with_index, value|
Sec total new wait
1 50 50 0 +
2 100 50 50 |+
3 150 50 100 ||+
4 200 50 150 |||+
5 250 100 150 +|||+
6 300 100 200 |+|||+
7 350 100 250 ||+|||+
8 400 100 300 |||+|||+
9 450 150 300 +|||+|||+
require 'uri'
require 'benchmark'
require 'net/http'
require 'rubygems'
require 'eventmachine'
require 'dnsruby'
# github.com/careo/em-http-request/

(This is the text of the keynote I gave at Startup Riot 2009. Will update when video becomes available.)

Hi everyone, I’m Chris Wanstrath, and I’m one of the co-founders of GitHub.

GitHub, if you haven’t heard of it, has been described as “Facebook for developers.” Which is great when talking about GitHub as a website, but not so great when describing GitHub as a business. In fact, I think we’re the polar opposite of Facebook as a business: we’re small, never took investment, and actually make money. Some have even called us successful.

Which I’ve always wondered about. Success is very vague, right? Probably even relative. How do you define it?

After thinking for a while I came up with two criteria. The first is profitability. We employ four people full time, one person part time, have thousands of paying customers, and are still growing. In fact, our rate of growth is increasing – which means January was our best month so far, and February is looking pretty damn good.

s1 = {:host=>'foo', :user => 'foobar'}
s2 = {:host=>'bar', :user => 'foobar'}
s3 = {:host=>'baz', :user => 'foobar'}
s4 = {:host=>'moo', :user => 'foobar', :options => {:password => 'barfoo'}}
def gate(s, s2, opts={})
gw = Net::SSH::Gateway.new(s[:host], s[:user], {:port => 22}.merge(opts))
gw_port = gw.open(s2[:host], s2[:port])
yield(gw_port)
ensure