Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nvk on github.
  • I am nvk (https://keybase.io/nvk) on keybase.
  • I have a public key whose fingerprint is D80E F5D7 4B3B 38CA C3F2 BBD6 1C9E 033C 6C65 8606

To claim this, I am signing this object:

@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,
@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 / gspace.sh
Last active December 16, 2015 08:09
Compress git repos (git gc) recursively
# Compress git repos (git gc) recursively
# Use as at will, by @nvk
gspace(){
for gitdir in `find ./ -name .git`;
do
workdir=${gitdir%/*};
hrline 44; # see http://gist.github.com/nvk/5340820
echo $workdir;
git --git-dir=$gitdir --work-tree=$workdir gc --aggressive;
ip(){
hrline 36
# Gets external IP from opendns.com
print -P "%F{240}|%f %F{$colorInfo}=> External IP%f `dig +short myip.opendns.com @resolver1.opendns.com` %F{240}|%f"
# Get's local IP from ipconfig
print -P "%F{240}|%f %F{$colorSecondary}=> Local IP %f `ipconfig getifaddr en0` %F{240}|%f"
# make line, https://gist.github.com/nvk/5340820
@nvk
nvk / hrline.zsh
Last active December 15, 2015 23:29
hrline() {
# Checks for stout if none gives a default number
if [ -z "$1" ]
then
local length=50
else
local length="$1"
fi
@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
@nvk
nvk / serverhere.zsh
Created April 2, 2013 21:52
server here
serverhere(){
open "http://localhost:8000";
python -m SimpleHTTPServer
}
@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 );
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);