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
The documentation for madlib is out of date because brew no longer supports compiler flags from the command line. | |
Select the appropriate steps according to your current install on OS X | |
*PYTHON* | |
brew install python | |
export PYTHON=/usr/local/bin/python3 | |
*Postgresql* |
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
# GOPATH helper | |
goPathFile="$HOME/.gopathsrc" | |
if [ -f "$goPathFile" ]; then | |
source "$goPathFile" | |
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
set history=256 | |
set autowrite | |
set autoread | |
set timeoutlen=250 | |
set clipboard+=unnamed | |
set directory=~/.vim/swap | |
set hlsearch | |
set incsearch |
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
1.9.3-p392 :026 > s | |
=> "DB2:/XMETA/NODE0000/DB2LOG" | |
1.9.3-p392 :028 > /^([^\/]*\/[^\/]*\/).*$/.match(s) | |
=> #<MatchData "DB2:/XMETA/NODE0000/DB2LOG" 1:"DB2:/XMETA/"> | |
1.9.3-p392 :030 > /^([^\/]*\/[^\/]*)\/.*$/.match(s) | |
=> #<MatchData "DB2:/XMETA/NODE0000/DB2LOG" 1:"DB2:/XMETA"> |
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
package main | |
import ( | |
"fmt" | |
"math" | |
"math/rand" | |
"time" | |
) | |
var pi, dev float64 |
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 | |
CONFIG=/etc/haproxy/haproxy.cfg | |
DAEMON=$(which haproxy) | |
function get_pid() { | |
PID=$(ps aux | grep haproxy | grep -v grep | awk '{print $2}') | |
} | |
function get_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
#!/bin/bash | |
trap 'echo Goodbye! && rm $cmdfile && kill $child; exit 1' INT | |
if [ -z $1 ] | |
then | |
echo "Usage: monitor_search hostname" | |
exit 1 | |
else | |
host=$1 | |
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 | |
url='http://www.sitetomonitor.com/provider_search?utf8=%E2%9C%93&search%5Bquery%5D=aba+therapist&search%5Blocation%5D=San+Francisco%2C+CA&commit=Search' | |
self=$(basename $0) | |
if [ -w "/var/run" ]; then | |
pidfile="/var/run/$self.pid" | |
else | |
pidfile="/tmp/$self.pid" | |
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
def keypad str | |
case str.downcase | |
when 'a'..'c' then '2' | |
when 'd'..'f' then '3' | |
when 'g'..'i' then '4' | |
when 'j'..'l' then '5' | |
when 'm'..'o' then '6' | |
when 'p'..'s' then '7' | |
when 'a'..'v' then '8' | |
when 'w'..'z' then '9' |
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 'stringio' | |
def capture_stdout | |
$stdout = StringIO.new | |
$stdin = StringIO.new("y\n") | |
yield | |
$stdout.string.strip | |
ensure | |
$stdout = STDOUT | |
$stdin = STDIN |
NewerOlder