Skip to content

Instantly share code, notes, and snippets.

@pgib
pgib / Function and command alias example
Created April 26, 2011 18:47
function-and-command-alias-example.vim
function StripTrailingWhitespace()
:%s/\s\+$//
echo "Trailing white space stripped."
endfunction
command Stripwp :call StripTrailingWhitespace()
@pgib
pgib / net.lighttpd.spawn-fcgi.plist
Created April 27, 2011 23:16
spawn-fcgi launchctl plist for use with php-cgi
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.lighttpd.spawn-fcgi</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
@pgib
pgib / com.coverallcrew.firewall.plist
Created April 28, 2011 06:33
Our firewall start-up script to forward port 80 to our local nginx on 8080
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.coverallcrew.firewall</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
@pgib
pgib / bbedit_colours.sh
Created May 6, 2011 19:51
My BBEdit Color Scheme
defaults write com.barebones.bbedit Color:Background -string "rgb(0,0,0)"
defaults write com.barebones.bbedit Color:CTagsIdentifier -string "rgb(57825,39937,11422)"
defaults write com.barebones.bbedit Color:ColorAttributesSeparately -string 1
defaults write com.barebones.bbedit Color:Comment -string "rgb(21845,21845,21845)"
defaults write com.barebones.bbedit Color:Comment:Ruby -string "rgb(34992,34992,34992)"
defaults write com.barebones.bbedit Color:Foreground -string "rgb(65535,65535,65535)"
defaults write com.barebones.bbedit Color:Foreground:CSS -string "rgb(56342,56342,56342)"
defaults write com.barebones.bbedit Color:GuideContrast -string 7
defaults write com.barebones.bbedit Color:HTMLAnchor -string "rgb(43690,0,0)"
defaults write com.barebones.bbedit Color:HTMLAttributeName -string "rgb(57528,45076,5799)"
@pgib
pgib / gist:965951
Created May 11, 2011 05:15
`brew install -v imagemagick` output
$ brew install imagemagick
Also installing dependencies: jpeg, little-cms
==> Downloading http://www.ijg.org/files/jpegsrc.v8c.tar.gz
File already downloaded and cached to /Users/patrick/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/jpeg/8c --disable-dependency-tracking
==> make install
/usr/local/Cellar/jpeg/8c: 17 files, 1.4M, built in 11 seconds
==> Downloading http://www.littlecms.com/1/lcms-1.19.tar.gz
File already downloaded and cached to /Users/patrick/Library/Caches/Homebrew
@pgib
pgib / brew doctor
Created May 12, 2011 05:45
brew install -v little-cms
$ brew doctor
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libdvdcss.2.0.7.dylib
/usr/local/lib/libdvdcss.2.dylib
@pgib
pgib / create-branch.sh
Created August 26, 2011 17:55
Put this in your shell's respective dot profile and smoke it!
# create a new git branch
function create-branch
{
local branchtype=$1
local name=$2
local issue=$3
date=`date +%Y%m%d`
if [ $# -lt 2 ]; then
@pgib
pgib / mydevices.html
Created October 14, 2011 22:40
Commented out code in Lion Server's My Devices
<!-- <div class="profile">
<div class="name">First Ad-Hoc</div>
<p class="description">This adds some stuff to your device.</p>
<a href="http://apple.com"><div class="button"><canvas></canvas></div></a>
<p class="getJoin">Get</p>
</div>
<div class="profile">
<div class="name">Second Ad-Hoc</div>
<p class="description">This adds some different stuff to your device.</p>
<a href="http://apple.com"><div class="button"><canvas></canvas></div></a>
@pgib
pgib / nginx.rb
Last active September 27, 2015 15:47
Update to nginx 1.2.6; add nginx-upload-progress-module
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.2.6.tar.gz'
sha1 '432059b668e3f018eab61f99c7cc727db88464e8'
devel do
url 'http://nginx.org/download/nginx-1.3.10.tar.gz'
sha1 '11cd44bc0479594fd2e5f7a65bf8f2c36ad5ec1e'
@pgib
pgib / archive_github_repo.sh
Created October 17, 2011 22:48
Put this in your shell's respective dot profile and smoke it!
archive_github_repo()
{
if [ ! -d .git ]; then
echo "You must run this from within the root of your git repo."
exit 1
fi
pwd=`pwd`
repo_url=`git config --local --get remote.origin.url`
repo_name=`echo $repo_url | awk -F / '{print $2}' | sed -e s/.git//`