Skip to content

Instantly share code, notes, and snippets.

View whymarrh's full-sized avatar

Whymarrh Whitby whymarrh

View GitHub Profile
@whymarrh
whymarrh / duplicates.sql
Created March 21, 2021 02:05
Select duplicate clues from the J! Archive
-- Using the db from https://github.com/whymarrh/jeopardy-parser
WITH duplicates(clue, occurrences) AS (
SELECT d.clue, COUNT(d.clue) AS occurrences
FROM documents AS d
WHERE d.clue NOT IN (
'=', '...',
'(missing clue)',
'(audio clue)', '[audio clue]', '[audio]',
'[Instrumental theme plays]', '[instrumental]',
'[Music plays]', '[theme music]',
@whymarrh
whymarrh / keybase.md
Created November 9, 2019 19:43
Keybase proof

Keybase proof

I hereby claim:

  • I am whymarrh on github.
  • I am whymarrh (https://keybase.io/whymarrh) on keybase.
  • I have a public key ASDvATuKuBF_Q8uauOaRThLUYqAwKVvHZ9d23lE_GdX57go

To claim this, I am signing this object:

@whymarrh
whymarrh / rx.patch
Created April 2, 2017 19:01
Fix the RxJS v4 type definitions
node_modules/rx/{package.json.bak => package.json} | 1 +
1 file changed, 1 insertion(+)
diff --git a/node_modules/rx/package.json.bak b/node_modules/rx/package.json
index b4ce765..c7871af 100644
--- a/node_modules/rx/package.json.bak
+++ b/node_modules/rx/package.json
@@ -113,5 +113,6 @@
"test": "grunt"
},
@whymarrh
whymarrh / RangeMap.kt
Created March 12, 2017 23:08
Map a value from one range to another
fun rangeMap(value: Double, from: ClosedRange<Double>, to: ClosedRange<Double>): Double {
require(value in from, { "value $value must be in source range $from" })
return to.start + (to.endInclusive - to.start) * (value - from.start) / (from.endInclusive - from.start)
}
@whymarrh
whymarrh / Dockerfile
Last active October 26, 2017 21:47
UDP broadcast quick playground
FROM alpine:3.6
RUN apk --update add python3
CMD ["python3"]
@whymarrh
whymarrh / b2w.md
Last active October 24, 2015 16:03
A list of Back to Work episodes
@whymarrh
whymarrh / serial_ports.py
Last active September 24, 2015 00:21
Create serial ports with Python
#!/usr/bin/env python3 -OO
import itertools
import serial
import shlex
import subprocess
MESSAGE = """
Hi there! You have a serial port:
@whymarrh
whymarrh / re.js
Created May 5, 2015 22:29
A silly re
var re = /^(?!app[\\\/])|(app[\\\/]test)/;
console.log();
console.log();
console.log();
console.log();
[
"app/test/Config.js",
"app/test/OtherConfig.js",
@whymarrh
whymarrh / hipchat_notify.py
Last active August 29, 2015 14:14
Rudimentary Jenkins + HipChat integration
import argparse
import requests
import json
ROOM_ID = ''
TOKEN = ''
HIPCHAT_ROOM_URL = 'https://api.hipchat.com/v2/room/{0}/notification'
@whymarrh
whymarrh / git-os-x-installer.bash
Last active August 29, 2015 14:08
Installation script for Git on OS X (modified from timcharper/git_osx_installer)
#!/usr/bin/env bash
set -e -o pipefail
LATEST_GIT_VERSION=$(curl http://git-scm.com/ 2>&1 | grep -A 2 '<span class="version">' | grep '[[:digit:]].[[:digit:]]' | tr -d ' ')
GIT_VERSION="${1:-$LATEST_GIT_VERSION}"
PREFIX="/usr/local/git"
SUDO="sudo"
NOW_SECONDS=$(date +%s)
THE_ABYSS="/dev/null"