Skip to content

Instantly share code, notes, and snippets.

View jakl's full-sized avatar
💭
🦊

James Koval jakl

💭
🦊
View GitHub Profile
@jakl
jakl / flare.json
Last active December 18, 2015 16:19 — forked from mbostock/.block
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@jakl
jakl / index.js
Created June 6, 2013 07:33
TamperMonkey Imo.im
// ==UserScript==
// @name Add space for double click highlight in imo.im
// @namespace http://imo.im
// @version 0.1
// @description add a space before imo.im posts so double click highlight is functional
// @match https://imo.im
// @copyright 2012+, @jakl
// ==/UserScript==
setTimeout(function(){
@jakl
jakl / cskit.js
Last active December 17, 2015 23:29
gunzip
(function(exports){
fetchGzipped = function(url, cb){
var req = new XMLHttpRequest()
req.open('GET', url, true)
req.responseType = 'arraybuffer'
req.onload = function(){
gzdata = new Uint8Array(req.response)
data = (new Zlib.Gunzip(gzdata)).decompress()
@jakl
jakl / flare.json
Last active December 17, 2015 20:29 — forked from mbostock/.block
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@jakl
jakl / README.md
Last active December 17, 2015 18:18
citation hackathon

Hackathon

Hack

@jakl
jakl / dump.rake
Last active December 16, 2015 22:20
Is it possible to automatically dump test/development data from a production rails app? Here's a rake task (./lib/tasks/dump.rake) that starts trying to do so.
require 'rubygems'
require 'csv'
require 'pry'
desc "Dump a representative set of test/dev data"
task :dump => :environment do
#Load models so they are available for the ActiveRecord::Base.descendants call
Dir.foreach("#{Rails.root}/app/models") do |f|
require f if f =~ /.*\.rb/
@jakl
jakl / index.js
Created April 24, 2013 05:42
Functional browser gunzip
var binary_xhr = require('binary-xhr');
var zlib = require('zlib-browserify');
binary_xhr('data.gz', function(e, data){
zlib.gunzip(new Uint8Array(data), function(e, result){
console.log(e, result); // e: undefined, result: Buffer {0: 80, 1: 75, 2: 3, 3: 4, 4: 20...}
});
});
@jakl
jakl / gist:5449459
Created April 24, 2013 03:44
Trying to use https://github.com/chrisdickinson/inflate in the browser. Be really awesome if this worked and was faster than https://github.com/imaya/zlib.js
window.Buffer = require('buffer');
var inflate = require('inflate');
var binary_xhr = require('binary-xhr');
var Stream = require('stream').Stream;
var util = require('util');
function FakeStream(){
this.readable = true;
};
@jakl
jakl / README.md
Created April 17, 2013 02:00 — forked from mbostock/.block
@jakl
jakl / README.md
Last active December 15, 2015 01:29
Cleanup your Twitter timeline by viewing noisiest users - unfollow loud mouths and hear those who are soft spoken. #Twiduster.

USAGE

npm install

Add some twitter creds from apps.twitter.com

then