Skip to content

Instantly share code, notes, and snippets.

Sarah Mount snim2

Block or report user

Report or block snim2

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
# Usage Example: $ clone-github github_id
# would clone all the git repositories managed under github_id at current path
# save it as /etc/profiles/
repos=`curl -skL $GITHUB_REPO_URI | grep 'title="Forks"' | sed "s/.*$GITHUB_ID\///" | sed 's/\/network"\stitle="Forks">//'`
View pdfstill
outfn=`basename $infn .pdf`.still.pdf
# Embed fonts.
gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outfn \
-dCompatibilityLevel=1.5 -dPDFSETTINGS=/prepress -c .setpdfwrite -f $infn
# Strip metadata crap added by Ghostscript.
exiftool -Title="" $outfn
snim2 / time-example.bash
Created May 13, 2014
Example of the time command
View time-example.bash
$ echo "must say /usr/bin/time in full here as BASH reimplements the command"
must say /usr/bin/time in full here as BASH reimplements the command
$ /usr/bin/time -v wc mpi-gmp.quadrature.c.html
163 1028 19555 mpi-gmp.quadrature.c.html
Command being timed: "wc mpi-gmp.quadrature.c.html"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 0%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.02
Average shared text size (kbytes): 0
snim2 / issue-tags.txt
Created Apr 16, 2014
Example tags from an issues list on Google Code
View issue-tags.txt
Efdhack-2012 = Suitable Issue for a 2012 hackday
Estimate-Hours = A developer estimates that this issue will take a few hours (or less) to resolve
Estimate-Days = A developer estimates that this issue will take a few days (or less) to resolve
Estimate-Weeks = A developer estimates that this issue will take a few weeks (or less) to resolve
Estimate-Months = A developer estimates that this issue will take a few months (or less) to resolve
Type-Defect = Report of a software defect
Type-Enhancement = Request for enhancement
Type-Task = Work item that doesn't change the code or docs
Type-Review = Request for a source code review
Type-Other = Some other kind of issue
snim2 / clock_res.c
Created Apr 2, 2014
Print available (Linux) system clock resolutions
View clock_res.c
/* Print a table of available timer frequencies. Linux only.
* (c) Sarah Mount <> 2014.
#include <stdio.h>
#include <string.h>
#include <sys/utsname.h>
#include <time.h>

Want to push to two Git Repos via a single command?

Want to do it easily via a simple .git edit?

My use case is pushing code that resides on Github as well as on Bitbucket. I want it available in both remote locations in case one is unavailable.

Here's how you do it:

Add the two remotes as normal

snim2 / .travis.yml
Last active Nov 7, 2016
Travis-CI recipe for testing LaTeX projects compiled by a Makefile
View .travis.yml
- sudo apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- sudo apt-get install chktex
- make
- chktex -W # Print version information.
- chktex -q -n 6 *.tex chapters.*.tex 2>/dev/null | tee lint.out
# If lint output is non-empty report an error.
- test ! -s lint.out
View gist:8639969
branch_mapping = [('default', 'master')]
target = "git+ssh://"
repo = hgapi.Repo(path)
for hgb, gb in branch_mapping:
repo.hg_command('bookmark', '-r', hgb, gb)
repo.hg_command("--config", "paths.default=" + target, "--config", "extensions.hggit=", "push")
snim2 /
Created Sep 5, 2013
A git pre-commit hook to test Python code for PEP8 compliance, and run unit tests via the pytest framework
#!/usr/bin/env python
Git pre-commit hook to enforce PEP8 rules and run unit tests.
Copyright (C) Sarah Mount, 2013.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
case "$1" in
/usr/local/bin/vim "$1"
*.md )
/usr/local/bin/mmdc "$1"
*.txt )
You can’t perform that action at this time.