This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is for a WordPress installed at /var/www/wordpress/blog, and accessed at http://www.example.com/blog. | |
server { | |
listen 80; | |
server_name blog.example.com; | |
root /var/www/wordpress; | |
index index.php; | |
access_log /var/log/nginx/blog.access.log; | |
error_log /var/log/nginx/blog.error.log notice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /blog { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect false; | |
proxy_pass http://IP-ADDRESS-OF-OTHER-SERVER; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# hack: Merge the latest changes from the master branch into your current branch | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0 | |
CURRENT="${ref#refs/heads/}" | |
git checkout master | |
git pull origin master | |
git checkout ${CURRENT} | |
git rebase master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# Git workflow ship script from: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html | |
# git name-rev is fail | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0 | |
CURRENT="${ref#refs/heads/}" | |
git checkout master | |
git merge ${CURRENT} | |
git push origin master | |
git checkout ${CURRENT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# dwf, aka "Done With Feature" script: deletes current branch and puts you back on master | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || exit 0 | |
CURRENT="${ref#refs/heads/}" | |
git checkout master | |
git branch -d ${CURRENT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Script to set all "fixed" Lighthouse tickets to deployed | |
require 'lighthouse_api/lighthouse' | |
Lighthouse.account = 'account' # put your account name in here | |
Lighthouse.token = 'abcdefghijklmnopqrstuvwxyz' # put your API token here | |
project = Lighthouse::Project.find(12345) # replace with your project's ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My .irbrc | |
require 'rubygems' | |
require 'irb/completion' | |
require 'pp' | |
require 'wirble' | |
Wirble.init | |
Wirble.colorize | |
# The following is a way to let you call various helpers from the Rails console, see: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Find duplicates in SQL from multiple columns | |
select name, email from emails group by name, email having count(*) > 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# zsh Git branch in your prompt, etc. | |
function precmd() { | |
# define colors | |
local RED="%{[1;31m%}" | |
local LIGHT_RED="%{[0;31m%}" | |
local CYAN="%{[1;36m%}" | |
local LIGHT_CYAN="%{[0;36m%}" | |
local BLUE="%{[1;34m%}" | |
local LIGHT_BLUE="%{[0;34m%}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'autotest/redgreen' | |
module Autotest::Growl | |
def self.growl(title, msg, img, pri=0, stick="") | |
system "/usr/local/bin/growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{stick}" | |
end | |
Autotest.add_hook :ran_command do |at| | |
results = at.results.last | |
OlderNewer