Skip to content

Instantly share code, notes, and snippets.

@burnto
burnto / _gradient.scss
Created February 25, 2011 07:01
Gradient scss mixin
// Vertical gradient scss mixin
@mixin gradient($start-color: #f3f3f3, $end-color: #fcfcfc) {
background: $start-color; /* for non-css3 browsers */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$start-color}', endColorstr='#{$end-color}'); /* ie */
background: -webkit-gradient(linear, left top, left bottom, from($start-color), to($end-color)); /* webkit */
background: -moz-linear-gradient(top, $start-color, $end-color); /* ff */
}
// --- Usage ---
@burnto
burnto / gist:943432
Created April 26, 2011 23:50
.bash_profile colors
export TERM=xterm-color
# set colors and prompt
#PS1="\[\e]2;\w\a\][\[\e[32m\]\u\[\e[0m\]@\[\e[31m\]\h\[\e[0m]\]:\[\e[35m\]\w\[\e[0m\]$ "
#PS2=">> "
#export PS1 PS2
export CLICOLOR="true"
export LSCOLORS="exfxcxdxbxegedabagacad"
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
alias gitgraph="git log --graph --full-history --all --color --pretty=format:\"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s\""
git pretty-log `git describe --tags HEAD~1 | awk '{split($0,a,"-"); print a[1]}'`..HEAD
@burnto
burnto / bash_profile.sh
Created September 7, 2011 00:20
bash_profile git status in prompt
# GIT COMPLETION
# (from https://github.com/git/git/blob/master/contrib/completion/git-completion.bash)
source ~/.git-completion.sh
# BASH PROMPT WITH GIT BRANCH
# Set the base PS1
# PS1="\u:\h \W$ "
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " \[\033[01;35m\](%s)\[\033[0m\]")$ '
@burnto
burnto / gist:1202437
Created September 8, 2011 02:09
Authorize.net reasons
"""
From http://www.authorize.net/support/merchant/Transaction_Response/Response_Reason_Codes_and_Response_Reason_Text.htm
"""
REASONS = [
# resp code, reason code, reason text, notes
[1, 1, "This transaction has been approved."],
[2, 2, "This transaction has been declined."],
[2, 3, "This transaction has been declined."],
[2, 4, "This transaction has been declined.", "The code returned from the processor indicating that the card used needs to be picked up."],
@burnto
burnto / gist:1266515
Created October 6, 2011 04:18
OpenCV python webcam example
#!/Users/brent/.virtualenvs/lumber/bin/python
import cv
cv.NamedWindow("w1", cv.CV_WINDOW_AUTOSIZE)
camera_index = 0
capture = cv.CaptureFromCAM(camera_index)
gx = gy = 1
@burnto
burnto / gist:1267618
Created October 6, 2011 15:00
PostgresSQL notes
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
https://github.com/mxcl/homebrew/issues/issue/2510
To build plpython against a specific Python, set PYTHON prior to brewing:
PYTHON=/usr/local/bin/python brew install postgresql
See:
http://www.postgresql.org/docs/9.0/static/install-procedure.html
@burnto
burnto / python2.6.rb
Created October 19, 2011 17:14
Python 2.6 Brew Formula
require 'formula'
<<-COMMENTS
This is the Homebrew formula for Python.
Versions
--------
This formula is currently tracking version 2.6.x.
@burnto
burnto / gist:1300190
Created October 20, 2011 01:32
sample gitconfig
Here is my ~/.gitconfig, for anyone interested in color, etc. :)
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green