Skip to content

Instantly share code, notes, and snippets.

View patricksnape's full-sized avatar

Patrick Snape patricksnape

View GitHub Profile
@patricksnape
patricksnape / push.bat
Created August 25, 2011 08:53
Set git tags at push
@ECHO OFF
python %HOMEDRIVE%%HOMEPATH%\development\push.py
git push
@patricksnape
patricksnape / cate.py
Created November 18, 2011 09:33
CATE results alerter
#!/usr/bin/python
from urllib2 import HTTPPasswordMgrWithDefaultRealm, HTTPBasicAuthHandler, build_opener, install_opener, urlopen
from base64 import b64decode
from BeautifulSoup import BeautifulSoup
import re
import smtplib
import pickle
username = 'USERNAME'
@patricksnape
patricksnape / points.txt
Last active December 24, 2015 11:49
Broken mesh from the FRGC dataset (spring2004/02463d652.abs)
This file has been truncated, but you can view the full file.
3.910502199999999817e+01 1.015628600000000006e+02
3.970768400000000042e+01 1.015956589999999977e+02
4.030049999999999955e+01 1.016027150000000034e+02
3.206443500000000313e+01 1.010909939999999949e+02
3.264228500000000111e+01 1.010517770000000013e+02
3.322689600000000354e+01 1.010345109999999949e+02
3.380118099999999970e+01 1.009869460000000032e+02
3.437677099999999797e+01 1.009448739999999987e+02
3.498895000000000266e+01 1.010099060000000009e+02
3.616383799999999837e+01 1.009953210000000041e+02
@patricksnape
patricksnape / custom.js
Created January 11, 2014 18:56
IPython restart and run all above shortcuts
%%javascript
IPython.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) {
if (IPython.notebook.mode == 'command') {
var selected_cell = IPython.notebook.get_selected_index();
IPython.notebook.session.restart_kernel();
$([IPython.events]).on('status_started.Kernel', function(){
IPython.notebook.execute_cells_above();
});
@patricksnape
patricksnape / ipython_nosetest.py
Created March 31, 2014 17:58
Nose plugin to run IPython notebooks as tests (run each notebook and check if any cells throw exceptions)
import os
import unittest
import nose
from IPython.kernel import KernelManager
from IPython.nbformat.current import reads
from nose.plugins.base import Plugin
from nose.util import anyp
@patricksnape
patricksnape / conda32.bat
Last active August 29, 2015 14:00
Conda switcher
@echo off
if "%CONDA_PATH%" == "" (
set "PATH_BEFORE_CONDA=%PATH%"
)
if not "%CONDA_PATH%" == "" (
call deactivate
)
set CONDA_PATH="C:\Users\pts08\Miniconda\32"
set "PATH=%CONDA_PATH%;%CONDA_PATH%\Scripts;%PATH_BEFORE_CONDA%"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@patricksnape
patricksnape / Cosine on Tumour Data.ipynb
Last active August 29, 2015 14:04
Cosine on Tumour Data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@patricksnape
patricksnape / seminar.ipynb
Created October 20, 2014 14:00
Seminar 20/10/2014
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.