Skip to content

Instantly share code, notes, and snippets.

View tommarshall's full-sized avatar

Tom Marshall tommarshall

View GitHub Profile
@tommarshall
tommarshall / gist:9376724
Created March 5, 2014 21:13
git checkout ambiguous reference example
$ git checkout v1.5.1
warning: refname 'v1.5.1' is ambiguous.
Switched to branch 'v1.5.1'
$ git --version
git version 1.8.3.4 (Apple Git-47)
// tests/update-contact.js
auth_creds = require('./auth_creds.json');
module.exports = {
setUp : function(browser) {
browser
.url("http://example.com")
.waitForElementVisible("body", 1000)
@tommarshall
tommarshall / simple_form.rb
Created August 22, 2013 14:58 — forked from clyfe/simple_form.rb
Bootstrap3 compatible simple_form initializer (with consistent Bootstrap 3 classes)
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@tommarshall
tommarshall / Gettext.tmLanguage
Created July 23, 2013 11:03
Textmate's gettext syntax highlighting, with an updated regex which does show blank lines as block red. https://github.com/textmate/gettext.tmbundle/blob/master/Syntaxes/Gettext.tmLanguage
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>
TODO: Command for copy original to untranslated, label as fuzzy, remove fuzzy, next fuzzy etc
Create meta scope for each entry
</string>
<key>fileTypes</key>
@tommarshall
tommarshall / nationalInsurance.js
Created July 16, 2013 21:14
JavaScript utility function for calculating UK national insurance contribution (2013).
/* =============================================================================
# UK National Insurance 2013 calculator utility function
#
# If you’re employed
# You pay Class 1 National Insurance contributions. The rates are:
#
# 12% on your yearly earnings between £7748 and £41444
# 2% on any yearly earnings over £7748
#
# 12% on your weekly earnings between £149 and £797