Skip to content

Instantly share code, notes, and snippets.

View kkaefer's full-sized avatar
🏳️‍🌈

Konstantin Käfer kkaefer

🏳️‍🌈
View GitHub Profile
@max-mapper
max-mapper / readme.md
Last active September 17, 2015 00:14
We Need An Automated Module Build System

We Need An Automated Module Build System

First, please read On Maintaining a Native Node Module

Problem: There is no standard way to build + distribute prebuilt binaries for node modules with native addons (e.g. C++ bindings).

There's a thing called NODE_MODULE_VERSION which is used to know if a native module was compiled for the correct version + flavor of node. If you are trying to load something compiled for e.g. iojs from February 2015 into node from March 2014 you will get an error something like Error: Module version mismatch. Expected 11, got 42. when you try and run your program. node uses numbers from 10 going up, and iojs uses numbers from 40 going up. The NODE_MODULE_VERSION gets bumped usually when V8 is upgraded, but sometimes for other reasons. It also gets even more complicated when you start talking about runtimes like Electron or Node-Webkit, but I won't get into that here. To my knowledge there is n

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
@kkaefer
kkaefer / pull-request
Created September 22, 2011 10:09
Converts an issue into a pull request. Works within one repository only and always pulls a branch into master. Requires github.user and github.token to be set.
#!/bin/sh
BRANCH_NAME=$(git symbolic-ref -q HEAD)
BRANCH_NAME=${BRANCH_NAME##refs/heads/}
BRANCH_NAME=${BRANCH_NAME:-HEAD}
REPO_NAME=`git config --get-regexp remote\..+\.url | perl -p -e 's/^remote\.\w+\.url\s+git\@github.com:(.+).git/\$1/'`
echo "Pulling $BRANCH_NAME into master of $REPO_NAME"
read -p "Issue #: " GITHUB_ISSUE
@dmitriy-kiriyenko
dmitriy-kiriyenko / console
Created May 16, 2011 12:51
Init.d to start/stop xvfb. Put it into /etc/init.d and chmod it to 755
apt-get install xvfb
apt-get install firefox
@kkaefer
kkaefer / bump
Created May 11, 2011 15:44
Bumps version numbers in package.json and creates a git tag for it
#!/usr/bin/env sh
version() {
ruby <<"EOS"
doc = File.read './package.json'
regex = /("version"\s*:\s*")([^"]+)(")/
cur = regex.match(doc)
if ENV['CMD'] == 'major' then
nxt = (cur[2].to_i + 1).to_s + ".0.0"
elsif ENV['CMD'] == 'minor' then
/**
* Module dependencies.
*/
var inspect = require('sys').inspect;
console.inspect = function(obj, depth){
if (!obj) return;
@torsten
torsten / google-ssl+links.user.js
Created December 29, 2010 00:57
Greasemonkey script, adds the missing links to Google Images, etc when using Google SSL Search.