Skip to content

Instantly share code, notes, and snippets.

View duncan-bayne's full-sized avatar

Duncan Bayne duncan-bayne

View GitHub Profile
@duncan-bayne
duncan-bayne / index.html
Created July 16, 2014 06:31
Simple charting demo
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>14 days @ 5 minute resolution</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }
ul {
9
/ \
7 10
/ \
3 8
@duncan-bayne
duncan-bayne / gist:772d36c63e9e2638ef87
Created October 30, 2014 04:57
Simultaneous messages from same originator
<messages>
<message>
<datestamp>2014-10-30 15:43:40</datestamp>
<direction>MO</direction>
<originator>61420817082</originator>
<recipient>61419129159</recipient>
<messagetext>A</messagetext>
<campaign></campaign>
<reference></reference>
</message>
S: <wait for connection on TCP port 110>
C: <open connection>
S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>
C: APOP mrose c4c9334bac560ecc979e58001b3e22fb
S: +OK mrose's maildrop has 2 messages (320 octets)
C: STAT
S: +OK 2 320
C: LIST
S: +OK 2 messages (320 octets)
S: 1 120
@duncan-bayne
duncan-bayne / gist:9daa251ab5a507b3099d
Created April 21, 2015 00:25
Open letter to Spotify re. Accessibility
Hi,
I'm writing to let you know that the Spotify client for OSX (and possibly
other OSs too) is inaccessible to people who are blind and otherwise disabled.
Several people, myself included, have raised this issue in an attempt to
have it fixed but we've been consistently ignored by Spotify staff.
E.g.:
➜ uhoh tree
.
├── foo
│   └── bar
│   └── baz
│   └── qux
└── -rf
3 directories, 2 files
➜ uhoh rm *
@duncan-bayne
duncan-bayne / xlsx-snippet.xml
Created September 3, 2015 23:25
Rounding issue in XLSX date cells
<sheetData>
<row r="1" customFormat="false" ht="12.8" hidden="false" customHeight="false" outlineLevel="0" collapsed="false">
<c r="A1" s="1" t="n">
<v>41552</v>
</c>
</row>
<row r="2" customFormat="false" ht="12.8" hidden="false" customHeight="false" outlineLevel="0" collapsed="false">
<c r="A2" s="1" t="n">
<v>41551.9999999998</v>
</c>
@duncan-bayne
duncan-bayne / No More Giphy™.user.js
Last active December 10, 2015 02:28
No More Giphy™
// ==UserScript==
// @name No More Giphy™
// @namespace duncan@bayne.id.au
// @description Hides all Slack messages from /giphy
// @include /https:\/\/.*\.slack\.com\/messages\/.*/
// @version 2
// @grant GM_log
// @require http://code.jquery.com/jquery-2.1.4.min.js
// @require http://underscorejs.org/underscore-min.js
// ==/UserScript==
@duncan-bayne
duncan-bayne / nmcli-bounce.sh
Created April 18, 2016 05:21
Bounce NetworkManager connections on timeouts
#!/bin/bash
SSID=$1
if [ -z "$SSID" ]; then
echo "usage: nmcli-bounce SSID"
exit -1
fi
HOST=cogent.co
@duncan-bayne
duncan-bayne / sp
Last active January 16, 2022 09:53 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#