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
dns-sd -P "U-verse Gateway" _http._tcp local 80 gateway.2wire.net 172.16.0.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
#!/usr/bin/env python | |
import sys | |
try: | |
import json | |
except ImportError: | |
print "Can't import JSON module. Make sure you're using Python 2.6 or above." | |
sys.exit(1) | |
try: |
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 'rubygems' | |
require 'sinatra' | |
require 'redis' | |
# To use, simply start your Redis server and boot this | |
# example app with: | |
# ruby example_note_keeping_app.rb | |
# | |
# Point your browser to http://localhost:4567 and enjoy! | |
# |
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
-- An iTerm 2 launch script. Opens three terminal windows, | |
-- logs them in to three different hosts, | |
-- and cd's to a common directory. | |
-- | |
-- Place in ~/Library/Application Support/iTerm/Scripts | |
-- | |
global remoteDirectory | |
set remoteDirectory to "/my/project" |
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 | |
# See: http://en.wikipedia.org/wiki/Kaprekar_constant | |
$MAX_DIGITS = 4 | |
$KAPREKARS_CONSTANT = 6174 | |
class Fixnum | |
def sort(padding=0) | |
ordered = Array.new |
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 | |
############################################################################### | |
# | |
# venv: A simple wrapper for Python virtualenv | |
# | |
############################################################################### | |
VIRTUALENV_ROOT_DIR=~/Projects/Virtualenv |
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
function _bash_git_status() { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function _bash_git() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/±\1$(_bash_git_status)/' | |
} | |
function prompt() { | |
local BLACK="\[\033[0;30m\]" |
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
--- /opt/local/lib/ruby1.9/gems/1.9.1/gems/cheat-1.2.1/lib/cheat.rb 2009-06-01 10:30:32.000000000 -0500 | |
+++ cheat.rb 2009-06-01 10:30:19.000000000 -0500 | |
@@ -1,5 +1,10 @@ | |
$:.unshift File.dirname(__FILE__) | |
%w[rubygems tempfile fileutils net/http yaml open-uri wrap].each { |f| require f } | |
+begin | |
+ PLATFORM = RUBY_PLATFORM | |
+rescue NameError | |
+ # ... then we're probably using Ruby < 1.9 | |
+end |
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/bash | |
# A helper script for working with GitHub Git repositories. | |
function git_dir_check() { | |
if [ ! -d ".git" ]; then | |
echo "Not a git repository!" | |
exit | |
fi | |
} |
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 | |
# Get the model number of your MacBook's LCD panel. | |
# Thanks, Ars Technica! | |
ioreg -lw0 | grep IODisplayEDID | sed "/[^<]*</s///" | xxd -p -r | strings -6 |
NewerOlder