Skip to content

Instantly share code, notes, and snippets.

@liuhenry
liuhenry / keybase.md
Last active March 29, 2016 13:12
keybase.md

Keybase proof

I hereby claim:

  • I am liuhenry on github.
  • I am liuhenry (https://keybase.io/liuhenry) on keybase.
  • I have a public key whose fingerprint is 5639 BA2F C750 CD97 C229 8ADB 912C 4D15 8614 78F2

To claim this, I am signing this object:

[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
# Shows little symbol '±' if you're currently at a git repo and '○' all other times
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
echo '○'
}
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
@liuhenry
liuhenry / YouTube live stream metadata
Last active December 17, 2015 01:29
Info object returned by YouTube from a live stream
{ hlsrange: 1,
video_id: '-3PUyG6zCWI',
thumbnail_url: 'http://i2.ytimg.com/vi/-3PUyG6zCWI/default.jpg',
keywords: [ '#hangoutsonair', 'Hangouts On Air', '#hoa' ],
tmi: 1,
sendtmp: 1,
hlsvp: 'http://www.youtube.com/api/manifest/hls_variant/signature/89DEC5D1D8E458933DE7214B22FFEEE2F7B6D24A.C6E91CE20D89B152B32C737AE449BDCB78C02397/fexp/932000%2C932004%2C906383%2C904479%2C901208%2C925714%2C929119%2C931202%2C900821%2C900823%2C912518%2C911416%2C930807%2C919373%2C906836%2C900824%2C912711%2C929606%2C910075/id/-3PUyG6zCWI.1/ipbits/8/playlist_type/DVR/pmbypass/yes/expire/1367903675/sver/3/sparams/cp%2Cid%2Cip%2Cipbits%2Cmaudio%2Cplaylist_type%2Cpmbypass%2Csource%2Cexpire/ip/108.245.185.181/key/yt1/maudio/1/upn/XtitIHZgvOU/cp/U0hVTFlLUV9MT0NONV9RRVVHOjJySmxOZC0tamVS/source/yt_live_broadcast/file/index.m3u8',
share_icons: 'http://s.ytimg.com/yts/swfbin/sharing-vflaKBv7W.swf',
abd: 1,
fexp:
@liuhenry
liuhenry / chute_uploader.py
Created June 28, 2012 02:41
Chute Upload using API v2 (Python)
import requests
import json
import os
import hashlib
class Chute:
BASE_URI = 'http://api.getchute.com'
def __init__(self, app_id, access_token):
@liuhenry
liuhenry / .vimrc
Last active October 6, 2015 11:28
Current vim config
" Vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle - required
Bundle 'gmarik/vundle'