Skip to content

Instantly share code, notes, and snippets.

@nvk
nvk / ck-sms-curl
Created August 5, 2014 18:26
Coinkite's Bitcoin API: Sending Bitcoin by SMS with Curl
$ curl `./ck-helper.py /v1/new/send` -d amount=0.020 -d account=0 -d 'dest=+1-416-555-1212' -X PUT | grep next_step
"next_step": "/v1/update/5E0000E8AB-BB1C1D/auth_send?authcode=dWkRqUCaNIag1qNtnXr3qZ24lGnwRExI",
$ curl `./ck-helper.py /v1/update/5E0000E8AB-BB1C1D/auth_send` -d authcode=dWkRqUCaNIag1qNtnXr3qZ24lGnwRExI -X PUT
@nvk
nvk / coinkite-bitcoin-api-curl-quote
Last active August 29, 2015 14:04
Bitcoin Api: Get a bitcoin price quote with curl via Coinkite
$ curl `./ck-helper.py /v1/spot_quote/BTC/CAD`
{
"args": {
"amount": 1,
"from_cct": "CAD",
"to_cct": "BTC"
},
"result": {
"currency": "BTC",
"decimal": 0.00155765,
Verifying that +nvk is my Bitcoin username. You can send me #bitcoin here: https://onename.io/nvk
@nvk
nvk / Coinkite Payment Button JWT Token Encoding with PHP
Last active August 29, 2015 14:27
Unofficial JWT Token Encoding with PHP for Coinkite's Payment Button
#
# Coinkite's documentation https://docs.coinkite.com/api/buttons.html
#
# Unofficial code sent to use by a user:
# Here is php sample code you may post on your site to do this whole JWT thing without any libraries:
#
1000, 'c' => 'USD'); //YOUR BUTTON OVERRIDE OPTIONS
@nvk
nvk / howto-filemerge-git-osx.md
Created June 27, 2012 18:40 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@nvk
nvk / gifu.sh
Created March 9, 2013 16:39
Git I've fucked up, please reset my mess.
# get's branch, fetches origin, resets.
alias gifu='branch=$(git rev-parse --abbrev-ref HEAD) && git fetch origin && git reset --hard origin/$branch'
body{
background:#D8D8D8 url(http://subtlepatterns.com/patterns/brillant.png);
font-family: Helvetica, Arial, sans-serif;
}
.input-field{
border-radius: 2px;
background: #FFFFFF;
border: 1px solid #BDBDBD;
-moz-box-shadow: inset 0px 5px 0px 0 rgba(0,0,0,0.10);
@nvk
nvk / gop-gip.zsh
Last active December 14, 2015 18:39
Open github project and issues page
# Open github project and issues page
# PS: I'm not a dev, I'm sure there is better ways of writing this.
# use at will, by @nvk
gop(){
url=$(git remote -v | perl -n -e 'm{:(.+?).git} && print $1,"\n"' | uniq );
open "http://github.com/$url"
}
gip(){
url=$(git remote -v | perl -n -e 'm{:(.+?).git} && print $1,"\n"' | uniq );
@nvk
nvk / serverhere.zsh
Created April 2, 2013 21:52
server here
serverhere(){
open "http://localhost:8000";
python -m SimpleHTTPServer
}
@nvk
nvk / gifdownloader.zsh
Created April 5, 2013 14:17
gif downloader
#!/bin/bash
curl http://www.onemenny.com/blog/pictures-from-a-developers-life/ | grep .gif | sed 's/^.*src="//g' | sed 's/".*//g'
# wget -i $list