Skip to content

Instantly share code, notes, and snippets.

Sam Salisbury samsalisbury

Block or report user

Report or block samsalisbury

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

Keybase proof

I hereby claim:

  • I am samsalisbury on github.
  • I am samsalisbury ( on keybase.
  • I have a public key ASB9YPaXQaf3WTgYzmcXIFh2fs6Vo8Lqd-9dS6VYuD9XqQo

To claim this, I am signing this object:

samsalisbury / query.jq
Last active Mar 13, 2019
Generating spreadsheet of Sous manifests + owners
View query.jq
.NumInstances != 0
and ( .SourceID.Location | startswith("") | not )
and ( .SourceID.Location | contains("hack") | not )
and ( .SourceID.Location | contains("demo") | not )
and ( .SourceID.Location | contains("sous") | not )
samsalisbury / vim-go-build-tags.vim
Created May 8, 2018
Getting vim-go and syntastic playing nicely with go build tags.
View vim-go-build-tags.vim
# First update vim-go and syntastic to latest versions.
# Then install/update go tools using :GoInstallBinaries and :GoUpdateBinaries
# Set default go build tags... Update ad-hoc with :GoBuildTags <new list>
let g:go_build_tags = "smoke integration"
# Get Syntastic to use build tags...
let g:syntastic_go_go_test_args = '-tags="smoke integration"'
let g:syntastic_go_go_build_args = '-tags="smoke integration"'
samsalisbury / connect
Last active Jan 19, 2016
connect: My SSH interactive session connection script
View connect
# I keep scripts like this in $HOME/bin and add that dir to my
# path, so I can call e.g. `connect` from anywhere.
[ -z "$1" ] && {
echo "usage: $0 <hostname>"; exit 3
samsalisbury /
Last active Jul 20, 2017
Resize graphite whisperdb mesos_stats output
# This script can be executed on a graphite node to resize output from
RULE="1m:14d 5m:60d 10m:120d 1h:2y"
# First set the retention for all, leaving the existing default aggregation (which in our config was avg, xfilesfactor=0.5)
find $DIR -name *.wsp | while read f; do $f $RULE; done
# Now override the aggregations for the following special cases that need summing (using xfilesfactor=0.1 as is common for summing in our config)
find $DIR -name *_time_secs.wsp -or -name failed.wsp -or -name lost.wsp -or -name finished.wsp | while read f; do
samsalisbury / si.go
Created Mar 4, 2014
Easier navigation of JSON unmarshalled to interface{}
View si.go
package main
Allows <d>easier</d> inelegant navigation of JSON unmarshalled to interface{}
type si struct {
value interface{}
samsalisbury / UserInputAnonymiser.cs
Created Dec 19, 2013
Anonymise certain fields in a blob of JSON using Json.Net + JToken
View UserInputAnonymiser.cs
using System.Linq;
using Newtonsoft.Json.Linq;
namespace ExternalApi.Logging
public static class UserInputAnonymiser
public static JToken Anonymise(JToken data)
foreach (var prop in data.Children<JProperty>())
samsalisbury /
Last active Dec 16, 2015
Create new django project including south, psychopg2, django-facebook
# Django settings for hidjango project.
DEBUG = True
# ('Your Name', ''),
samsalisbury / .gitconfig
Last active Sep 24, 2019
Git diff and merge with p4merge (OSX)
View .gitconfig
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/ "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
tool = p4merge
samsalisbury / monadicTimeout.js
Created Jun 13, 2012
JavaScript monadic timeout (jQuery plugin)
View monadicTimeout.js
// Provides safe way to ensure that you only have a single timeout
// set for a particular event, in the face of browsers not always
// firing the expected events...
// Usage example:
// var myTimeout = $.monadicTimeout(function() { doSomething(); }, 500);
// $(".some-class").mouseenter(myTimeout.clear);
// $(".some-class").mouseleave(myTimeout.set);
You can’t perform that action at this time.