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/ruby | |
require 'webrick' | |
require 'optparse' | |
options = { :port => 4000, :host => 'localhost', :root => '.' } | |
OptionParser.new do |opts| | |
opts.banner = "Usage: webrick.rb [options]" | |
opts.on("-p", "--port [port]", "Set the port to use, defaults to 4000.") do |p| |
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
# PS1 Prompt Style Script | |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo " ("${ref#refs/heads/}")" | |
} | |
# PS1 prompt color vars | |
RED="\[\033[1;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" |
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
<?xml version="1.0" encoding="UTF-8"?> | |
- pages = sitemap.resources.find_all{ |page| page.source_file.match(/\.html/) and not page.source_file.match(/source\/test\// ) } | |
-# Fill this array in with pages you don't want in the sitemap. | |
- excluded_paths = ['404'] | |
- host = "http://yoursite.com/" | |
%urlset{ :xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9" } | |
%url | |
%loc= host | |
%priority 0.3 | |
%lastmod= DateTime.now.to_time.iso8601 |
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
# Make Tab autocomplete regardless of filename case | |
set completion-ignore-case on | |
# List all matches in case multiple possible completions are possible | |
set show-all-if-ambiguous on | |
# Immediately add a trailing slash when autocompleting symlinks to directories | |
set mark-symlinked-directories on | |
# Use the text that has already been typed as the prefix for searching through |
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 bash | |
# Take all the changes and run them through PHP Lint. Let the commit fail if this fails. | |
git diff --cached --name-status | awk '{ if ($1 != "D") print $2}' | grep -e \.php$ | xargs -n1 php -l | |
exit $? |
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
[alias] | |
# View the SHA, description, and history graph of the latest 20 commits | |
l = log --pretty=oneline -n 20 --graph | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status | |
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" | |
changelog = log --pretty=format:\" * %s\" | |
shortnocolor = log --pretty=format:\"%h %cr %cn %s\" | |
# View the current working tree status using the short format | |
s = status |
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
brew rm freetype | |
brew install https://raw.github.com/mxcl/homebrew/0e450f2c2be7450934a3fdcc6537e3fa90c118aa/Library/Formula/freetype.rb | |
brew unlink freetype | |
brew install freetype # So dependency does not fail | |
brew switch freetype 2.4.11 |
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
+----+-------+-------------------------------+ | |
| id | name | total_cold_inquiries_received | | |
+----+-------+-------------------------------+ | |
| 2 | Mike | 1 | | |
| 4 | Bill | 2 | | |
| 5 | Kate | 1 | | |
| 6 | Sue | 1 | | |
| 7 | Linda | 2 | | |
| 8 | Mary | 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
+----------------+-------+---------------------+---------------------+ | |
| sender_user_id | name | num_users_contacted | num_users_responded | | |
+----------------+-------+---------------------+---------------------+ | |
| 3 | Greg | 1 | 1 | | |
| 1 | John | 4 | 0 | | |
| 7 | Linda | 1 | 1 | | |
| 6 | Sue | 2 | 2 | | |
+----------------+-------+---------------------+---------------------+ |
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
-- Setup some tables. | |
CREATE TABLE `users` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(45) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=1; | |
CREATE TABLE `internal_messages` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`owner_user_id` int(11) DEFAULT NULL, |
OlderNewer