Skip to content

Instantly share code, notes, and snippets.

Martijn Vermaat martijnvermaat

Block or report user

Report or block martijnvermaat

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
takluyver /
Created Sep 6, 2014
Flatten notebooks for git diff

Copy to somewhere on $PATH. Then, in the root of a git repository, run these commands:

echo "*.ipynb diff=ipynb" >> .gitattributes 
git config diff.ipynb.textconv

When you change a notebook and run git diff, you'll see the diff of flattened, simplified notebooks, rather than the full JSON. This does lose some information (metadata, non-text output), but it makes it easier to see simple changes in the notebook.

This doesn't help with merging conflicting changes in notebooks. For that, see

martijnvermaat / userContent.css
Last active Aug 29, 2015
Hide comments on Losse Veter (
View userContent.css
* Hide comments on Losse Veter (
* Most of the user comments on Losse Veter are either racist or zealot
* epistels about doping. With this Firefox setting, you can enjoy just
* the track and field news.
* Edit this file and copy it as userContent.css into your Firefox
* profile-directory/chrome/
martijnvermaat /
Last active May 1, 2019
Notes on my Raspberry Pi server config

Notes on my Raspberry Pi server config

This describes how I installed and configured my Raspberry Pi model B (512MB).

The Pi is mainly used as SSH jump host, IRC client, Git server, backup fileserver, etc. It doesn't need stellar performance, it just has to be cheap, low in power usage, and secure.

Raspbian on encrypted root

martijnvermaat /
Last active Jun 10, 2019
View IPython notebooks in GitLab

Viewing IPython notebooks in GitLab

GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).

martijnvermaat /
Last active Jan 28, 2020
The IPython Notebook on an SGE cluster

IPython Notebook on an SGE cluster

This guide documents how we set up an easy workflow for using the IPython Notebook on our compute cluster managed with Sun Grid Engine (SGE).

Summary: We provide a script to the cluster users that runs qrsh to schedule an ipython notebook job using SSL and password protection.

Installing IPython

gnarf /
Last active Feb 21, 2020
git pr - Global .gitconfig aliases for Pull Request Managment


Either copy the aliases from the .gitconfig or run the commands in


Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
class TableCell(object):
bg_colour = None
def __init__(self, value, header=False, bg_colour=None, text_colour=None):
self.value = value
self.header = header
self.bg_colour = bg_colour
self.text_colour = text_colour
def _make_css(self):
vsbuffalo /
Created Aug 10, 2012
The Ten Commandments of Scientific Coding

The Ten Commandments of Scientific Coding

  1. Thou shall use version control.

  2. Thou shall comment thy code.

  3. Thou shall use existing libraries whenever possible.

  4. Thou shall try to unit test.

import itertools
from collections import Counter
def euler_52():
for i in itertools.count(1):
nums = [str(i * j) for j in range(1, 7)]
s = frozenset(nums[0])
sall = set()
if sall == s:
rodw /
Last active Feb 19, 2020
A simple script to backup an organization's GitHub repositories, wikis and issues.
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
You can’t perform that action at this time.