Skip to content

Instantly share code, notes, and snippets.

<div id="imageholder">
<div class="thumb_dark"></div>
<div class="thumb_med">
<a href="images/portfolio/electricpink.jpg" class="colorbox" title="ElectricPink Wallpaper Design" onmouseover="image1.src='images/thumbs/electricpink_down.jpg';" onmouseout="image1.src='images/thumbs/electricpink_up.jpg';" title="Electric Pink">
<img name="image1" src="images/thumbs/electricpink_up.jpg" alt="Electric Pink Type Poster" />
</a>
</div>
# put this in ~/.bash_profile or whatever
ruby_or_irb () {
if [ "$1" == "" ]; then
irb
else
ruby "$@"
fi
}
alias ruby="ruby_or_irb"

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

#!/bin/sh
#
# Counter-script to Travis Squires' git-promote script
# (http://hoth.entp.com/2008/11/10/improving-my-git-workflow)
# Removes a 'promoted' branch from the git config file.
curr_branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
git config --remove-section "branch.${curr_branch}"
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost db001 db002 db003 db004 web030 web048
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
<?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.panpainter.phpfcgi</string>
<key>EnvironmentVariables</key>
<dict>
<key>PHP_FCGI_CHILDREN</key>
(?xi)
\b
( # Capture 1: entire matched URL
(?:
[a-z][\w-]+: # URL protocol and colon
(?:
/{1,3} # 1-3 slashes
| # or
[a-z0-9%] # Single letter or digit or '%'
# (Trying not to match e.g. "URI::Escape")
[alias]
up = !sh -c 'git pull && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..'
// Run via OS X Terminal.app to block junk tweets in Tweetie.
// Info: http://atebits.posterous.com/test-filtering-in-tweetie-for-mac
defaults write com.atebits.tweetie-mac filterTerms -array "@gowalla" "http://gowal.la" "@foursquare" "http://4sq.com"

Snippets

This repo is just a collection of snippets that I've wanted to hang on to. Not unlike gists, but more for my own not-keeping purposes. Hopefully someone else will find these as useful as I do. If you have any questions, you can email me at [email protected]. Thanks!

-Mike

WARNING

As these are nothing more than snippets, I really make no promise of extensive documentation. Where I can, I'll make notes, but I can't promise that they'll mean much to anyone other than me. You're more than welcome to ask me to clarify, but please keep in mind that initial caveat.