This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Convert a FlyBuys card number to a barcode | |
def get_check_sum_from_thirteen_digit_code(card_number) | |
evens = 0 | |
odds = 0 | |
# Loop over all characters | |
card_number.chars.each_with_index do |character, index| | |
# Don't include the last character - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
Run via `go run main.go` | |
Test via `curl -i localhost:4000` | |
Load test via https://github.com/rakyll/hey | |
hey -n 500000 -c 50 -q 166 -m GET http://localhost:4000 | |
Summary: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// | |
// Run the server | |
// go run server.go | |
// | |
// Expose via ngrok | |
// ngrok http 8080 | |
// | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# | |
# Assumes you have run 'github_get_all.sh' to get the latest git repos for your org | |
# | |
# Note:This script will ONLY work reliably if you have run 'github_get_all.sh on an empty | |
# directory, so that all repos are freashly cloned and clean | |
# | |
# Iterate over all the github repos under the cwd, for each reports if | |
# branch1 is behind branch2 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# | |
# Checkout all repos, or brings branches up to date for an Org | |
# | |
read -d '' helptxt <<- "HELP_MSG" | |
Checkout all repos for a github organisation \\n | |
\\n | |
Usage:\\n | |
\\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# - Run dockerised schemaspy against a postgres db | |
# - write the output to a host directory | |
# - Opens the generated website in your broswer | |
# | |
# Assumes you have already got the schemaspy docker image eg: `docker pull schemaspy/schemaspy:snapshot` | |
# | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ $# -ne 3 ]; then | |
echo "Usage:" | |
echo "" | |
echo " `basename $0` <unix socket file> <host> <listen port>" | |
echo "" | |
echo "For example:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VAGRANT_LOG=info vagrant init ubuntu/trusty64 | |
INFO global: Vagrant version: 1.8.5 | |
INFO global: Ruby version: 2.2.3 | |
INFO global: RubyGems version: 2.4.5.1 | |
INFO global: VAGRANT_LOG="info" | |
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant" | |
INFO global: VAGRANT_OLD_ENV_VAGRANT_LOG="info" | |
INFO global: VAGRANT_OLD_ENV_TERM="xterm-256color" | |
INFO global: VAGRANT_OLD_ENV_SSH_AUTH_SOCK="/private/tmp/com.apple.launchd.Kfz21yAIM0/Listeners" | |
INFO global: VAGRANT_OLD_ENV_LOGNAME="davidoram" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query = Sidekiq::RetrySet.new | |
callbacks = query.select {|j| j.klass == 'CallbackNotificationWorker' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts " -- > called blah_blah_method" | |
puts caller.select{ |f| f =~ /flybuys/ } |
NewerOlder