Skip to content

Instantly share code, notes, and snippets.

@burnto
burnto / sample_cardio_phonegap.html
Created April 4, 2012 18:47
Sample code using card.io PhoneGap plugin
<h1>Scan Example</h1>
<p><button id='scanBtn'>Scan now</button></p>
<script type="text/javascript">
function onDeviceReady() {
var onCardIOComplete = function(response) {
console.log("card.io scan result: " + response.card_number);
// response fields include card_type, redacted_card_number,
// card_number, expiry_month, expiry_year, cvv, zip
$ git push
Counting objects: 32, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 2.11 KiB, done.
Total 21 (delta 18), reused 0 (delta 0)
remote: /data/github/current/lib/github/config/resque.rb:27: undefined method `constantize' for "GitHub::Jobs::RepositoryUpdateLanguage":String (NoMethodError)
remote: from /data/github/current/lib/github/config/resque.rb:26:in `each'
remote: from /data/github/current/lib/github/config/resque.rb:26
remote: from /data/github/current/lib/rock_queue.rb:9:in `require'
{
"cmd": ["lessc", "-x", "$file", "$file_path/$file_base_name.css"],
"selector": "source.css.less"
}
@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
@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: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 / 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: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 / 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\]")$ '
git pretty-log `git describe --tags HEAD~1 | awk '{split($0,a,"-"); print a[1]}'`..HEAD