Skip to content

Instantly share code, notes, and snippets.

@lifo
lifo / gist:11172
Created September 17, 2008 00:53
# Released under WTFPL - http://sam.zoy.org/wtfpl/
module PoorMansMigrations
def self.extended(base)
base.class_inheritable_accessor :migration_columns
base.migration_columns = []
end
def column(name, type, options = {})
self.migration_columns << {:column_name => name, :column_type => type, :options => options}
end
environment: production
chdir: /home/acoplet/www/acoplet/current/
address: 127.0.0.1
user: acoplet
group: acoplet
port: 8000
pid: /home/acoplet/www/acoplet/current/tmp/thin.pid
rackup: /home/acoplet/www/acoplet/current/config.ru
log: /home/acoplet/www/acoplet/current/log/thin.log
max_conns: 1024
load 'deploy' if respond_to?(:namespace)
set :application, "acoplet"
set :user, "acoplet"
set :use_sudo, false
set :scm, :git
set :repository, "git@github.com:jpemberthy/acoplet.git"
set :deploy_via, :remote_cache
set :deploy_to, "/home/#{user}/www/#{application}"
require 'rubygems'
require 'sinatra'
set :environment, :production
set :port, 8000
disable :run, :reload
require 'acoplet'
run Sinatra::Application
require 'rubygems'
require 'sinatra'
Sinatra::Application.default_options.merge!(
:run => false,
:env => :production
)
require 'acoplet'
run Sinatra.application
upstream acoplet {
server 127.0.0.1:8000;
}
server {
listen 80;
server_name 127.0.0.1 live;
access_log /home/acoplet/www/acoplet/current/log/thin.log;
root /home/acoplet/www/acoplet/current/;
error_log /home/acoplet/www/acoplet/current/log/error.log;
@defunkt
defunkt / startupriot.markdown
Last active September 15, 2023 18:11
Startup Riot 2009 Keynote

(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.

# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
require 'masquerade'
run Sinatra::Application
@tekkub
tekkub / icalendar.rb
Created June 8, 2010 05:46 — forked from dcparker/icalendar.rb
GCal ruby lib
require 'net/http'
require 'uri'
require 'time'
class Time
def self.gcalschema(tzid) # We may not be handling Time Zones in the best way...
tzid =~ /(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)Z/ ? # yyyymmddThhmmss
# Strange, sometimes it's 4 hours ahead, sometimes 4 hours behind. Need to figure out the timezone piece of ical.
# Time.xmlschema("#{$1}-#{$2}-#{$3}T#{$4}:#{$5}:#{$6}") - 4*60*60 :
Time.xmlschema("#{$1}-#{$2}-#{$3}T#{$4}:#{$5}:#{$6}") :