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
## gemdoc | |
if ( which "gem" >/dev/null ) ; then | |
gemdoc() { | |
for e in lynx w3m elinks links /usr/bin/open ; do | |
if ( which $e >/dev/null ) ; then | |
HTML_OPEN="${e}" | |
fi | |
done | |
$HTML_OPEN `/bin/ls -1t $(gem env gemdir)/doc/$1*/rdoc/index.html | grep "\/$1\-[0-9]" |head -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 ruby | |
require "optparse" | |
require "tempfile" | |
require "rubygems" | |
require "roo" | |
require "fastercsv" | |
require "addressable/uri" | |
OptionParser.new do |opts| | |
opts.banner = "Usage: [options] <file1> [file2 ...]" |
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
+__rvm_parse_args:422> [[ -z 4.3.10 ]] | |
+__rvm_parse_args:578> [[ -z '' && -n 1.9.2 ]] | |
+__rvm_parse_args:578> rvm_action=use | |
+__rvm_parse_args:580> [[ 0 -eq 1 || -n '' ]] | |
+__rvm_parse_args:15> [[ -n fetch ]] | |
+__rvm_parse_args:17> rvm_token=fetch | |
+__rvm_parse_args:19> [[ 1 -gt 0 ]] | |
+__rvm_parse_args:19> next_token=1.9.2 | |
+__rvm_parse_args:19> shift | |
+__rvm_parse_args:21> case fetch (fetch|version|srcdir|reset|debug|reload|update|monitor|notes|implode|seppuku|question|answer|env) |
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 | |
USER="root" | |
PASS="" | |
HOST="localhost" | |
TYPE="QUICK" | |
usage() { | |
echo "$0 [--host hostname] [--user username] [--pass password] [--type {valid mysql check table type}]" | |
echo " [--scan {scans ~/.my.cnf for user & password]" |
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 | |
date_range() { | |
# Output list of dates from $1 to $2 | |
} | |
for d in $(date_range 2011-01-01 2011-02-01) ; do | |
my_command $d | |
done |
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
export _GNUDATE="date" | |
if [ "${OSTYPE:0:6}" = "darwin" ] && command -v gdate >/dev/null 2>/dev/null ; then | |
export _GNUDATE="gdate" | |
fi | |
date2stamp() { | |
$_GNUDATE --utc --date "$1" +%s | |
} | |
stamp2date() { | |
$_GNUDATE --utc --date "1970-01-01 $1 sec" "+%Y-%m-%d %T" |
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 | |
## | |
# Don't be a dumbass and screw this up. | |
# If you modify this to be more awesome and don't tell me about it you are an assface. | |
# - @chorn | |
## | |
DB="" | |
FIELD="" | |
VALUE="" | |
TODO="" |
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
simple_launchctl() { | |
command=$1 | |
server=$2 | |
for plist in ~/Library/LaunchAgents/*.plist ; do | |
if [[ `grep -c Cellar "${plist}"` -ne 0 ]] ; then | |
abbrev=`echo $plist | sed -E -e 's/^.*\///' -e 's/^[[:alnum:]]*\.[[:alnum:]]*\.//' -e 's/\.plist$//' -e 's/([[:alnum:]][[:alnum:]][[:alnum:]]).*/\1/'` | |
if [[ "$server" == "$abbrev" ]] ; then | |
launchctl $command -w "${plist}" | |
return | |
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
#!/bin/bash | |
GZIP="gzip --best --rsyncable --quiet" | |
for DEST in $* ; do | |
[ ! -d "${DEST}" ] && exit -1 | |
echo Running \"${GZIP}\" on everything in \"${DEST}\" | |
TRACKING="/tmp/${RANDOM}_parallel_gzip" | |
mkdir -p "${TRACKING}" |
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 $HOME/.* -maxdepth 5 -type d -name .git -not -path "*.rvm/*" | while read r ; do echo $r && cd "$r/../" && git pull -q ; done ; cd $HOME |
OlderNewer