Skip to content

Instantly share code, notes, and snippets.

Dougal J. Sutherland dougalsutherland

Block or report user

Report or block dougalsutherland

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fourier_coefs_mex.c
#include <mex.h>
#include <math.h>
#define INDEX_TYPE uint8_T
void get_fourier_coefs(const double * X, const INDEX_TYPE * inds,
const double * mins, const double * ptps,
int num_pts, int dim, int num_bases, int M,
View connect-keyboard.scpt
#!/usr/bin/env osascript
-- based on
tell application "System Events" to tell process "SystemUIServer"
set bt to (first menu bar item whose description is "bluetooth") of menu bar 1
click bt
tell (first menu item whose title is "CMU keyboard") of menu of bt
tell menu 1
if exists menu item "Connect"
click menu item "Connect"
Script to set the OSX desktop background to the top picture from a given
NOTE: sets it for the current space (on all monitors), but not other spaces.
There doesn't seem to be an AppKit API to change it for all spaces.
TODO: set it in the sqlite db instead:
dougalsutherland /
Last active Aug 29, 2015
Mirror a conda repository
#!/usr/bin/env python
from __future__ import print_function
import json
import os
import sys
def check(path, checksum=False):
if checksum:
from conda.utils import md5_file
missing = set()
View scikit-learn rbf sampler.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

I hereby claim:

  • I am dougalsutherland on github.
  • I am dougalsutherland ( on keybase.
  • I have a public key whose fingerprint is 8900 ABA1 C715 5902 C7E0 7DD3 D429 4787 32BA 67CC

To claim this, I am signing this object:

View chi2 histogram SVM example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
dougalsutherland /
Created Jan 1, 2010
A bash script for managing ssh tunnels for smtp (or whatever)
while getopts 'D:p:s:h:P:' OPTION
dougalsutherland /
Created Jan 7, 2010
A script to set up an hg-to-git clone
# hg-to-git
# sets up a clone of a remote mercurial repository to a git repo
# relies on the wonderful tools from
echo "---- making the project in $PROJ_NAME"
View gist:430959
from import NoArgsCommand, CommandError
from django.conf import settings
import datetime
import sys, os, os.path
DUMP_DIRECTORY = os.path.expanduser("~/db-backups/")
DUMP_PATTERN = "gazjango_%Y-%m-%d_%H-%M.sql.bz2"
class Command(NoArgsCommand):
def handle_noargs(self, **options):
You can’t perform that action at this time.