Skip to content

Instantly share code, notes, and snippets.

View koenbok's full-sized avatar

Koen Bok koenbok

View GitHub Profile
View open_github_commit.js
var match = window.location.pathname.match(/([^/]+)\/([^/]+)\/commit\/([0-9a-f]{40,40})$/);
if (match == null)
console.log("Could not parse window name");
var user = match[1];
var repo = match[2];
var commit = match[3];
$.get("" + user + "/" + repo + "/" + commit, null, function(data) {
var filenames = { return x.filename })
import sys
import os
import filecmp
import subprocess
assert len(sys.argv) == 3, 'Usage: <script> path1 path2'
def run(command):[command], shell=True)
View appcast.js
AppCast Dowloader (c) 2010 Sofa BV (Koen Bok)
Returns the url for the latest version in an AppCast url.
jQuery > 1.4
koenbok / backbone.html
Created November 25, 2010 00:29
Backbone Experiment
View backbone.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" charset="utf-8" src=""></script>
<script type="text/javascript" charset="utf-8" src=""></script>
<script type="text/javascript" charset="utf-8" src=""></script>
View Constants
# -*- encoding: utf-8 -*-
constants = {}
constants['weightunits'] = {
'KG': 'Kilogram',
'LB': 'Pound'
constants['continents'] = {
koenbok / Android Review
Created March 29, 2011 09:05
Reviewing a Nexus S by a guy who is used to an iPhone 4
View Android Review
- You never have to attach it to the computer, not even for software upgrades
- Call quality and reception is sometimes better then my iPhone
- The dashboard or home is really nice with widgets and shortcuts (like wifi settings)
- Regular mini USB cable, although iPod cables are pretty common now too
- I don't really feel like I miss any apps, and most standard apps are done very nicely
- Some stuff is really smart like having a 2 second delay for locking after the screen dims down
- Most of the time it feels pretty fast
- I feel like I have more insight in the device (which is good because I'm geeky)
View gist:1243614
var api = new FB.Messages();
api.login("koenbok", "password", function(result) {})
api.threads.fetch({limit: 100, tags: ["inbox", "unread"]}, function(results) {}) // list with threads
api.threads.count({limit: 100, tags: ["inbox", "unread"]}, function(results) {}) // thread count
api.messages.fetch({}, function(results) {}) // all messages for thread
api.messages.put({, ...}, function(results) {}) // send a new message
koenbok / uilayer-bug.html
Created November 12, 2011 00:30
UILayer Bug
View uilayer-bug.html
<html lang="en">
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
var UILayer = Move.require("UILayer");
UILayer.debug = true;
koenbok / friendfeed.sql
Created May 24, 2012 06:20
Key Value a la FriendFeed
View friendfeed.sql
DROP TABLE IF EXISTS person_index_name;
DROP TABLE IF EXISTS person_index_age;
key CHAR(32) NOT NULL,
val TEXT,
koenbok / Cactus Performance
Created August 24, 2012 06:38
Cactus multithreaded results
View Cactus Performance
16 Threads: 6.05s user 4.08s system 131% cpu 7.687 total
2 Threads: 4.89s user 2.25s system 122% cpu 5.822 total
1 Thread: 3.36s user 0.65s system 99% cpu 4.035 total