Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am billyvg on github.
  • I am billy (https://keybase.io/billy) on keybase.
  • I have the public key with fingerprint 502B 567B D829 C2AB C7ED  ADA5 B47F 92BD 7C87 79E2

To claim this, I am signing this object:

require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@billyvg
billyvg / gist:4733228
Created February 7, 2013 18:57
vim/janus indent behavior for javascript
// Desired
var a,
b,
c,
d;
// what vim is doing
var a,
b,
c,
Modules/gcmodule.c:348: visit_decref: Assertion "gc->gc.gc_refs != 0" failed.
refcount was too small
object : <weakref at 0x2c14a48; to 'gevent.core.http_request' at 0x2c14998>
type : weakref
refcount: 1
address : 0x2c14a48
[push]
default = upstream
[alias]
co = checkout
ci = commit
st = status
list: (socket, msg, fn) ->
results = []
expectedCount = 0
addResult = (result) ->
results.push result
fn results if results.length is expectedCount
r.lrange 'boards', 0, -1, (err, items) ->
expectedCount = items.length
@billyvg
billyvg / gist:2932337
Created June 14, 2012 19:20
Backbone.js ListView + RowView
class ListView extends Backbone.View
constructor: (options) ->
super
@view = options.view if options.view?
@collection.on 'add', @addRow, @
@collection.on 'remove', @removeRow, @
@collection.on 'reset', @render, @
@
@billyvg
billyvg / gist:2839956
Created May 31, 2012 00:53
Bootstrap Typeahead + Backbone.js
class TypeaheadView extends Backbone.View
tagName: 'input'
initialize: (@options) ->
@source = options.source if options.source?
@
# Retrieves the Backbone Model that matches this view's value
# Will have problems if you have multiple Models with the same attribute that
# you are using as the typeahead's source.
getModel: () ->
'''Searches wikipedia and returns first sentence of article
Scaevolus 2009'''
import re
from util import hook, http
api_prefix = "http://wiki.guildwars2.com/api.php"
search_url = api_prefix + "?action=opensearch&format=xml"
@billyvg
billyvg / .tmux.conf
Created March 29, 2012 23:01
Tmux conf
set-option -g default-command "reattach-to-user-namespace -l zsh"
# bindings
unbind C-b
unbind %
set -g prefix C-a
bind-key C-a last-window
bind-key R source-file ~/.tmux.conf
# pane bindings