Skip to content

Instantly share code, notes, and snippets.

View whymarrh's full-sized avatar

Whymarrh Whitby whymarrh

View GitHub Profile
@whymarrh
whymarrh / manifest.json
Last active July 24, 2016 16:44
Minimal 'New Tab' page - a Chrome extension. See adamschwartz/chrome-new-tab.
{
"name": "Minimal New Tab",
"version": "0.0.0",
"manifest_version": 2,
"description": "A minimalist New Tab page.",
"chrome_url_overrides" : {
"newtab": "newtab.html"
}
}
@whymarrh
whymarrh / status.bash
Created November 25, 2013 01:28
Display unsigned exit status as signed value.
perl -e 'exit -1'
perl -e "print unpack('c', pack('C', $?)), \$/"
@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"
@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 / 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 / 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 / b2w.md
Last active October 24, 2015 16:03
A list of Back to Work episodes
@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 / 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 / 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"
},