Skip to content

Instantly share code, notes, and snippets.

View n3bulous's full-sized avatar

Kevin McFadden n3bulous

View GitHub Profile
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@n3bulous
n3bulous / Gemfile
Created July 25, 2012 01:49 — forked from mm53bar/Gemfile
Automagically launch an EC2 image and then provision it using sunzi
source 'http://rubygems.org'
gem 'sunzi'
gem 'rake'
gem 'fog'
@n3bulous
n3bulous / sphinx.rb
Created July 20, 2012 18:56 — forked from twerth/sphinx.rb
Mac homebrew Sphinx 0.9.9 formula
require 'formula'
class Libstemmer < Formula
# upstream is constantly changing the tarball,
# so doing checksum verification here would require
# constant, rapid updates to this formula.
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz'
homepage 'http://snowball.tartarus.org/'
end
@n3bulous
n3bulous / gist:3105047
Created July 13, 2012 14:03 — forked from reagent/gist:3100660
Open Conference Expectations

Open Conference Expectations

LOL

// ==UserScript==
// @name GitHub delete all notifications button
// @namespace http://www.github.com/micolous/delete-all-notifications
// @description Adds a button to allow you to delete all notifications on a page.
// @include http://github.com/inbox/notifications*
// @include https://github.com/inbox/notifications*
// ==/UserScript==
/*
@n3bulous
n3bulous / mapreduce2mysqlimport.rb
Created April 4, 2012 21:40
Processing Map Reduce Output by Line (first draft)
#!/usr/bin/env ruby
require 'slop'
require 'aws/s3'
class FileProcessor
def initialize(file_path)
@file_path = file_path
end
@n3bulous
n3bulous / gist:1917833
Created February 26, 2012 17:19
n3bulous' frankentheme
# ZSH Theme - Preview:
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
local rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v)›%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="╭─ ${user_host} ${current_dir} ${rvm_ruby} ${git_branch}
╰─ %B%! %* $%b "
@n3bulous
n3bulous / un_haml.rb
Created June 27, 2011 16:12 — forked from kamali/gist:550231
switch haml to erb
## based on the example at:
## http://gist.github.com/17371
##
## put me in lib/un_haml.rb (in the haml-based project)
##
## call me on the command line thus:
## $ script/runner UnHaml app/views/layouts/application.html.haml
## $ script/runner UnHaml */*/*/*.haml
##
class UnHaml < Haml::Engine
@n3bulous
n3bulous / geokit_config.rb
Created March 10, 2011 04:16
monkey patching geokit to support google premier
# Monkey Patch to enable google premier
module Geokit
module Geocoders
@@google_client_id = nil
__define_accessors
class GoogleGeocoder
private
def self.do_geocode(address, options = {})
bias_str = options[:bias] ? construct_bias_string_from_options(options[:bias]) : ''
#!/bin/env bash
# git-create-branch <branch_name>
if [ $# -ne 1 ]; then
echo 1>&2 Usage: $0 branch_name
exit 127
fi
branch_name=$1
git push origin origin:refs/heads/${branch_name}