Skip to content

Instantly share code, notes, and snippets.

View macdiesel's full-sized avatar
🚲

Brian Beggs macdiesel

🚲
  • edX
  • Boston, MA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am macdiesel on github.
  • I am macdiesel (https://keybase.io/macdiesel) on keybase.
  • I have a public key whose fingerprint is 3E73 CEE3 2202 65BF 2C9D 525F FBC0 1157 DB52 40B6

To claim this, I am signing this object:

import os
import sys
import requests
import click
HIPCHAT_API_URL = "http://api.hipchat.com"
NOTIFICATION_POST = "/v2/room/{}/notification"
AUTH_HEADER = "Authorization: Bearer {}"
@macdiesel
macdiesel / bluetooth-reset.sh
Created April 27, 2016 15:38
Reset bluetooth on osx after wake from sleep renders it unresponsive
#!/bin/sh
# This script will reset the bluetooth on an OSX when bluetooth is unresponsive after waking from sleep.
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@macdiesel
macdiesel / Courses_agg.js
Created August 7, 2015 20:25
Select unique courses from edx courseware modulestore.active_versions
result = db.modulestore.active_versions.aggregate(
[
{"$group": { "_id": { course: "$course", org: "$org", run: "$run" } } }
]
);
printjson(result.toArray());
@macdiesel
macdiesel / gist:2725838
Created May 18, 2012 15:22
Parse query string
function getUrlVars(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;