Skip to content

Instantly share code, notes, and snippets.

willprice /
Created May 7, 2015 14:14
Git analytics
echo "Generating statistics"
gitinspector \
--hard=true \
--file-types=cshtml,coffee,cs \
--format=htmlembedded \
--grading=true \
--exclude=".*css" \
// Each process runs this code.
wants_to_enter[id] = true;
// Be polite and let them enter
turn = other_process_id;
while (wants_to_enter[other_process_id] == true && turn == other_process_id) {
// let them enter critical section
wants_to_enter[id] = false;
willprice / Config.ini
Created July 13, 2015 22:24
Configuration file for bug.n setting XMonad like defaults (at least, like my XMonad config!)
# bug.n Configuration file.
# Vim-ish window movement commands
# Monitor commands
willprice / .cvimrc
Last active September 15, 2015 15:18
cVim settings
let mapleader = ","
let barposition = "bottom"
let configpath = '/home/will/.cvimrc'
let hintcharacters = "asdfhjkl"
let locale = "uk"
let searchalias g = "google"
let blacklists = ["*://*", "*://*", "@*"]
willprice / gist:1575531
Created January 7, 2012 18:12
Gmail Checker
// Gmail Notifier
// Author: Will Price
// Date: Jan 2011
// Website:
// Description:
// A simple sketch that waits for the number of unread messages to come over serial
// Use 'gmail_daemon' inconjunction for a physical mail notification system
// Macros
willprice / gist:2863376
Created June 3, 2012 13:03
Chemistry - RPA review


The Kekule structure of benzene is wrong because:

  • Bond length between carbon atoms are all constant and it's somewhere between the length of a c-c bond and a c=c bond (c-c longer than c=c)
  • Enthalpy change of hydrogenation is less than expected => the structure is more stable than initially expected
  • Does not undergo typical alkene reactions => less reactive

These traits arise due to benzene's structure which is due to multiple p-orbitals overlapping forming a delocalised pi system of electrons (in this case, it contains 6 electrons as it has 6 p-orbitals).

  • Low reactivity is due to the spreading out of the electrons which decreases the electron density of the bonds and therefore reduces it's reactivity with electrophiles as they are less strongly attracted.
  • The lower enthalpy change of hydrogenation of benzene compared with the kekule structure is due to the greater stability of the delocalised pi system compared to the localised pi bonds (which are more electron dense), the greater t
willprice /
Created December 24, 2015 21:26
git setup
git config --global ""
git config --global "Will Price"
git config --global core.editor viim
# Short commands
git config --global checkout
git config --global branch
git config --global commit
git config --global status
git config --global alias.lg 'log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit'
willprice / print_uint8_t
Created November 24, 2013 12:16
Print out the bits of a 'uint8_t' for debugging
void print_uint8_t(uint8_t n) {
int i;
for (i = BITSOF(n); i >= 0; i--)
printf("%d", (n & (1<<i)) >> i);
willprice / BITSOF
Created November 24, 2013 12:16
Get the number of bits of a type
#define BITSOF(x) (sizeof(x) * 8)
willprice /
Last active January 9, 2016 15:46
Command to flash the Arduino Due GCode (CNC controller) software called G2 (a fork of TinyG) to an Arduino Due


  1. Press 'Reset' on the Duet (RepRap Pro board)
  2. wait ~1 second
  3. Run ./