Skip to content

Instantly share code, notes, and snippets.

View wolph's full-sized avatar

Rick van Hattem wolph

View GitHub Profile
# 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.
def spam():
def spam():
def spam():
def spam():
def spam():
def spam():
def spam():
def spam():
def spam():
def spam():
#!/usr/bin/python
# ############################################################################
# INFORMATION
# ############################################################################
# Developed by: Steven Johnson
#
# Last Updated: 11/13/2013 4:00AM PST
#
# Description: Auto-Delete Watched Items In Plex
#
@wolph
wolph / qlikview_test.html
Last active August 29, 2015 14:00
Testing Qlikview Extension scripts using Qva emulation outside of Qlikview
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Qlikview Extension Test</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@wolph
wolph / timer.py
Created October 11, 2014 10:47
Python timer generator for simple duration measurement
import datetime
def timer(print_=True):
last = datetime.datetime.now()
while True:
now = datetime.datetime.now()
delta = now - last
if print_:
print 'Duration: %s' % delta
@wolph
wolph / recreate_virtualenv.sh
Last active August 29, 2015 14:08
Virtualenv recreating using virtualenvwrapper. Tested with OS X Homebrew but should work with any linux/unix system
#!/bin/zsh -e
if [ ! -d "$PROJECT_HOME" ]; then
echo 'Your $PROJECT_HOME needs to be defined'
echo 'http://virtualenvwrapper.readthedocs.org/en/latest/install.html#location-of-project-directories'
exit 1
fi
if [ "" = "$1" ]; then
echo "Usage: $0 <project_name>"
#!/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
@wolph
wolph / whitelist_ssl_certificates_chrome.sh
Last active August 25, 2020 19:21
Easily whitelisting SSL certificates in Chrome under OS X
#!/usr/bin/env bash -e
HOST=$(echo "$1" | sed -E -e 's/https?:\/\///' -e 's/\/.*//')
if [[ "$HOST" =~ .*\..* ]]; then
echo "Adding certificate for $HOST"
echo -n | openssl s_client -connect $HOST:443 -servername $HOST \
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
| tee "/tmp/$HOST.cert"
sudo security add-trusted-cert -d -r trustRoot \
@wolph
wolph / math_with_sticks_solver.py
Last active August 29, 2015 14:18
Solver for "math with sticks" puzzles
import re
sticks = {
0: 6,
1: 2,
2: 5,
3: 5,
4: 4,
5: 5,
6: 6,
@wolph
wolph / play_external.user.js
Created April 15, 2015 11:01
Userscript to play files in external media player
// ==UserScript==
// @name Play in external player
// @namespace http://wol.ph/
// @version 1.0
// @grant GM_getValue
// @grant GM_openInTab
// @grant GM_registerMenuCommand
// @grant GM_setValue
// @include http://*
// @include https://*