Skip to content

Instantly share code, notes, and snippets.

View lunaisnotaboy's full-sized avatar
🏳️‍⚧️
nya

Luna Nova lunaisnotaboy

🏳️‍⚧️
nya
View GitHub Profile
config.action_mailer.smtp_settings = {
:address => "mail.authsmtp.com",
:domain => "famspam.com",
:port => 2525,
:user_name => "user",
:password => "pass",
:authentication => :cram_md5
}
# by bryan helmkamp with slight modification by chris wanstrath
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow
module GitCommands
extend self
def diff_staging
`git fetch`
puts `git diff origin/production origin/staging`
end
# my new favorite bashrc function
# quickly inspect source files in style
function pless {
pygmentize $1 | less -r
}
@defunkt
defunkt / god.rb
Created November 18, 2008 18:04 — forked from mojombo/gist:26183
rails_root = "/data/github/current"
20.times do |num|
God.watch do |w|
w.name = "dj-#{num}"
w.group = 'dj'
w.interval = 30.seconds
w.start = "rake -f #{rails_root}/Rakefile production jobs:work"
w.uid = 'git'
@defunkt
defunkt / startupriot.markdown
Last active October 18, 2024 23:34
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.

# deploy to staging from your current topic branch, with ease
set :branch, "origin/#{`git branch`.scan(/^\* (\S+)/)}"
# version 2.0 of http://ozmm.org/posts/easy_rails_asset_ids_with_git.html
repo = Grit::Repo.new('/path/to/your/app/shared/cached-copy')
js = repo.log('deploy', 'public/javascripts', :max_count => 1).first
css = repo.log('deploy', 'public/stylesheets', :max_count => 1).first
ENV['RAILS_ASSET_ID'] = js.committed_date > css.committed_date ? js.id : css.id
"""A small wrapper file for parsing rST files at Github."""
__author__ = "Jannis Leidel"
__copyright__ = "Copyright (C) 2008 Jannis Leidel"
__license__ = "Public Domain"
__version__ = "0.1"
try:
import locale
locale.setlocale(locale.LC_ALL, '')
# This is a config file for ProxyMachine. It pulls the username out of
# the Git stream and can proxy to different locations based on that value
# Run with `proxymachine -c examples/git.rb`
class GitRouter
# Look at the routing table and return the correct address for +name+
# Returns "<host>:<port>" e.g. "ae8f31c.example.com:9418"
def self.lookup(name)
puts "Proxying for user #{name}"
"localhost:9418"
# you'd obviously have more settings somewhere
set :repository, "[email protected]:defunkt/github.git"
set :branch, "origin/master"
namespace :deploy do
desc "Deploy the MFer"
task :default do
update
restart
cleanup