Skip to content

Instantly share code, notes, and snippets.

View jfrazee's full-sized avatar

Joey jfrazee

View GitHub Profile
@jfrazee
jfrazee / citecut.rb
Created July 5, 2012 21:48
Cut unused entries from .bib files
require 'set'
require 'bibtex'
# Usage: ruby citecut.rb <latex> <bib>
# Get the citekeys used in the LaTeX doc
citekeys = Set.new
open(ARGV[0]).readlines.each do |line|
line.scan(/\\\w*cite\w*{([\w\d,:-]+)}/) do |c|
citekeys.merge c[0].split(',')
@jfrazee
jfrazee / twitter_filter.js
Created January 10, 2012 23:22
Twitter Streaming API with Node.js Request module
var request = require('request');
function filter(options, callback){
var params = {
uri: "https://stream.twitter.com/1/statuses/filter.json",
}
if (typeof options['oauth'] !== 'undefined'){
params.oauth = options.oauth;
delete options.oauth;
}