Skip to content

Instantly share code, notes, and snippets.

Canoeing along...

Sarah Mount snim2

Canoeing along...
View GitHub Profile

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 / 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>
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 / 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
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
# 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">//'`

Creating the post-commit file

Note: If you want to use your personal Twitter account to post commits, go to Step 2

  1. Create a new Twitter account for your commit messages. Example
  2. Go to and Sign In with your Twitter account you are posting commit messages to.
  3. Hover over your username in the top-right corner after signing in and select "My Applications"
  4. Create a new application
  5. The name, description, and site can all be whatever you want, but leave Callback URL empty
  6. Under "Application Settings" click "modify app permissions" next to "Access level"
View gist:4af7b12076a31b13190c
$ export PYTHONPATH=$PYTHONPATH:/opt/pypy:. ; py.test -v tests/compiler/_*.py -k test_ast_functionstatement -s
======================================================== test session starts =========================================================
platform linux2 -- Python 2.7.6 -- pytest-2.2.4.dev2 -- /usr/bin/python
collecting 0 items[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-default-16/platcheck_0.c -o /tmp/usession-default-16/platcheck_0.o
[platform:execute] gcc /tmp/usession-default-16/platcheck_0.o -pthread -lintl -lrt -o /tmp/usession-default-16/platcheck_0
collecting 23 items/home/snim2/Desktop/working/snim2/naulang/naulang/compiler/ ParserGeneratorWarning: 48 shift/reduce conflicts
collected 110 items
tests/compiler/ test_ast_functionstatement PASSED
snim2 / tocloft_example
Last active Aug 29, 2015
An example use of tocloft and IEEE format
View tocloft_example
snim2 / keywords.tex
Created Aug 25, 2014
Example LaTeX listings with mixed alphanumeric keywords
View keywords.tex