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 Cosine, sine of normal distribution.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View cosine basis linear classifier with normal noise.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fourier_coefs_mex.c
#include <mex.h>
#include <math.h>
#define INDEX_TYPE_ID mxUINT8_CLASS
#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 http://stackoverflow.com/a/23018886/344821
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
click
tell menu 1
if exists menu item "Connect"
click menu item "Connect"
View set_wallpaper.py
#!/usr/bin/python
'''
Script to set the OSX desktop background to the top picture from a given
subreddit.
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:
http://1klb.com/blog/desktop-background-on-os-x-109-mavericks.html/
@dougalsutherland
dougalsutherland / check_repodata.py
Last active Aug 29, 2015
Mirror a conda repository
View check_repodata.py
#!/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 set_wallpaper.py
#!/usr/bin/python
'''
Script to set the OSX or Unity desktop background to the top picture from a
given subreddit.
NOTE: on OSX, 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.
'''
from __future__ import division, print_function, unicode_literals
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.
View keybase.md

I hereby claim:

  • I am dougalsutherland on github.
  • I am dougalsutherland (https://keybase.io/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.
You can’t perform that action at this time.