Skip to content

Instantly share code, notes, and snippets.

View wolph's full-sized avatar

Rick van Hattem wolph

View GitHub Profile
@wolph
wolph / activetable.js
Last active July 4, 2019 15:27 — forked from stevesouders/activetable.js
ActiveTable is a bookmarklet that makes any table sortable. It also allows you to remove columns, and it remembers the removed columns for next time. Use alt+click to UNhide all columns (and clear memory). This version sorts numerically if possible and if that's not possible it puts the numbers first and letters after
// ActiveTable - a bookmarklet to make tables sortable and editable
function init() {
var aHrows = getHrows();
var numHrows = aHrows.length;
var aHidden = getHiddenColumns();
ATpopup = document.createElement("div");
ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;";
@wolph
wolph / main.py
Last active January 18, 2018 20:16 — forked from jorenham/main.py
Best exception handling in Python
import sys
import webbrowser
def main():
return 42/0
def excepthook(type_, value, traceback):
webbrowser.open_new_tab('https://stackoverflow.com/search?q=[python] {} {}'.format(type_, value))
#!/bin/sh
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit
-- the above is some shell trickery that lets us write the rest of
-- the file in plain applescript
-- Usage:
-- For a simple reload and nothing else:
-- # sh reload_chrome.sh
-- For a reload with activating a different app after (iTerm in this case):
-- # sh reload_chrome.sh iTerm
# Author: Raynor Vliegendhart
# LICENSE: MIT
import numpy
def multirater_kfree_np(n_ij, n, k):
'''
Computes Randolph's free marginal multirater kappa for assessing the
reliability of agreement between annotators.
@wolph
wolph / clean-merged-branches.sh
Created January 13, 2012 06:58
clean-merged-branches
#!/bin/sh
#/ Usage: clean-merged-branches [-f]
#/ Delete merged branches from the origin remote.
#/
#/ Options:
#/ -f Really delete the branches. Without this branches are shown
#/ but nothing is deleted.
#/ -n Dry-run, only show what would be removed.
set -e