Skip to content

Instantly share code, notes, and snippets.

View pkulak's full-sized avatar

Phil Kulak pkulak

View GitHub Profile
@pkulak
pkulak / gist:61de475a74d824a9d875
Created February 10, 2015 23:41
Roku BIF File JavaScript Parser
// Takes an ArrayBuffer; returns an array of these objects:
// {
// seconds: *number of seconds into the video of this image*,
// bytes: *the bytes of this image, as an ArrayBuffer*
// }
var parseBif = function(buffer) {
var data = new Uint8Array(buffer);
// Make sure this really is a BIF.
var magicNumber = [0x89, 0x42, 0x49, 0x46, 0x0d, 0x0a, 0x1a, 0x0a];
package main
import (
"bufio"
"log"
"os"
)
var concurrency = 100
@pkulak
pkulak / hash.go
Created May 19, 2014 19:09
A super-convoluted way to find my email address.
package main
import (
"crypto/md5"
"fmt"
"io"
"runtime"
)
var chars = "abcdefghijklmnopqrstuvwxyz"
@pkulak
pkulak / StreamParser.java
Created February 21, 2012 18:10
InputStream parser for the Twitter streaming API.
package com.showyou.importer.twitter;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by Phil Kulak
* Date: 1/1/12
*
* Parses an InputStream from the Twitter site streams API. The stream needs to be length-delimited (?delimited=length)