Skip to content

Instantly share code, notes, and snippets.

View robskillington's full-sized avatar
⌨️

Rob Skillington robskillington

⌨️
View GitHub Profile
@robskillington
robskillington / harlemshake.js
Created September 18, 2014 19:42
harlemshake.js - shamelessly ripped for fun re-use
(function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@robskillington
robskillington / classify.py
Created July 8, 2014 14:52
Document language classifier
#!/usr/bin/env python
'''docclass.py: Language classifier'''
__author__ = "Rob Skillington"
from math import sqrt, log
import re, os, sys, getopt
DEFAULTS = {
@robskillington
robskillington / gist:e310ba0627293e2df91e
Created June 3, 2014 15:16
Swift synchronous request
class Request : NSObject {
func send(url: String, f: (String)-> ()) {
var request = NSURLRequest(URL: NSURL(string: url))
var response: NSURLResponse?
var error: NSErrorPointer = nil
var data = NSURLConnection.sendSynchronousRequest(request, returningResponse: &response, error: error)
var reply = NSString(data: data, encoding: NSUTF8StringEncoding)
f(reply)
}
@robskillington
robskillington / gist:7282087
Created November 2, 2013 18:38
Fix for mysql2 gem fails to compile with MySQL 5.6.12 on OS X with Homebrew
Blatantly borrowed from StackOverflow
Uninstall MySQL 5.6.12:
brew unlink mysql
brew uninstall mysql
Go to the homebrew directory:
cd /usr/local
Go to version 5.6.10 (you can find a list of versions by running brew versions mysql:
@robskillington
robskillington / callAsync.js
Created November 4, 2011 10:01
callAsync playground
// Anonymize
(function () {
Function.prototype.callAsync = function () {
var self = this, args = arguments, result = {returned:false};
setTimeout(function () { result.returnVal = self.apply(self, args); result.returned = true; }, 0);
return result;
}
})();