Skip to content

Instantly share code, notes, and snippets.

View e-dard's full-sized avatar

Edd Robinson e-dard

View GitHub Profile
@e-dard
e-dard / gist:9ba4d385b34d62e8c399
Last active August 29, 2015 14:10
Bandit Service API

NB - all these calls require an Authorisation header:

Authorization: token SECRETTOKEN

Creating an Experiment

If you don't already have a lab under the account, you need to create a lab:

POST /v1/accounts/<aid>/labs

with an optional JSON request body:

@e-dard
e-dard / gist:8804532
Created February 4, 2014 14:27
Serial and parallel implementations of Merge Sort in Go. Parallel implementation is slower because too many goroutines are spawned. A worker pool equal to number of CPU cores is better approach.
package sort
import (
"runtime"
)
func MergeSortParallel(list []int) []int {
if len(list) <= 1 {
return list
}
@e-dard
e-dard / id_rsa.pub
Last active December 18, 2015 19:19
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA6aPpP9xlo5zwpJUoDTCbVaSpS2q2P1Rapm6enmv2vJIRAwOYfAZPGrTA3Ol3Tl5NZV9K8alI4wUo3IsbjEPeb21wjCFhPpBlIo/dHjtR2TNDqr7EYTzHD5iGAYpxnG5UWUkso3OyxFUyQ6FqeP/oexY6cgrd0EE6iB3SuY2xvfLtZJi7TqLaYZw2Qmk6MKSLSu6Y9R7w7B9fnwSGjaJMNfmgS4BJ+yOwze7TiwMGMmYYFDbQHhewLxWG11hbnVn/c5CidAkE4zxxZriyPj4GBf+KHSuqyHDc9Wqz/Ye7XzEHVXIJVOq5UZ2YQjuaTQO5SKg8Z9z4EnaCX5pRhz3SBCePb2h7SkwEX78e+v8JBwAr7j9Gq/sW5Oa+cRxBi2bb6/ue7vEBtJRWIMeMYLsFWdnFjby/oRXQn5y900Le2Q1olilqLgJRi91quM21FQxEO+uSuXZYh5dq7qqJW28Nj6lvCh+x05wfRou8In9m82PYB58A3sXBDJw+ruzpP9bcN/njhFLaKSOyeKDDg6Ah3fTvVRQ7oXtZAPKBLJY2s9fvJNFzkbKcwqydxayYn7m1LvMDwScpJAJu2A8SiPCHVsHsSsuHFJm+QQpRaRyqxatzGOiRSax2Opyu6u2ewOnx5l64Ad0zF45ETa8ELasE4UAapso7vCAO61F66JxA31U= me@edd.io
# By renaming function and using alias, one can
# get original crontab back by typing /crontab -r
alias crontab='cr'
cr () {
if [[ "$1" == "-r" ]]; then
echo "Saved the day."
else
/usr/bin/crontab $1
fi
@e-dard
e-dard / linkedin.py
Created June 6, 2012 17:11
Checks if your password is in the Linkedin password dump.
#!/usr/bin/env python
# encoding: utf-8
"""
linkedin.py
Created by Edward Robinson on 2012-06-06.
You'll need to go find the password dump yourself.
Google combo_not.zip
"""