Skip to content

Instantly share code, notes, and snippets.

View cliffom's full-sized avatar

Michael Clifford cliffom

View GitHub Profile
@cliffom
cliffom / cloudinit.sh
Created February 9, 2016 01:27
Docker Cloud AWS Kickstart Script
#!/bin/bash
DEPLOYMENT_TIMEOUT="5m"
METADATA_SERVICE_URL="http://169.254.169.254/latest/meta-data"
apt-get update
# apt-get upgrade -y
apt-get install -y jq python-pip
pip install docker-cloud awscli
@cliffom
cliffom / gem_reset.sh
Created September 16, 2016 20:46
Reset Gems
#!/bin/bash
docker-compose stop web
docker-compose rm web
docker rm `docker ps -a | grep radpadrails_web | awk '{ print $1 }'`
docker volume rm radpadrails_gems
docker volume rm radpadrails_tmp
docker-compose run --rm web bundle install
@cliffom
cliffom / update_ruby.sh
Created September 20, 2016 23:54
Use Ruby 2.2.5
rbenv install 2.2.5
rbenv local 2.2.5
rbenv global 2.2.5
rbenv rehash
gem install bundler
bundle install
@cliffom
cliffom / .tmux.conf
Last active July 19, 2017 19:18
My tmux configuration
set -g default-terminal "screen-256color"
# mouse support
set-option -g mouse on
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# remap prefix to Control + a
package main
import "os"
import "github.com/pusher/pusher-http-go"
func main() {
channel := os.Args[1]
event := os.Args[2]
message := os.Args[3]
client := pusher.Client{

Keybase proof

I hereby claim:

  • I am cliffom on github.
  • I am cliffom (https://keybase.io/cliffom) on keybase.
  • I have a public key ASB7dVgpj2jX-svj40206sCvbTy9S86FFSqbzFAuPYb3WAo

To claim this, I am signing this object:

package main
import (
"crypto/sha256"
"fmt"
"io/ioutil"
"os"
"strconv"
)
defmodule HashData do
def open_file do
File.read! "rand.txt"
end
def hash_contents(n) do
open_file()
|> hash_contents(n)
end
N=1
PHP: 0.089
Ruby: 0.140
Go: 0.008
Elixir: 0.00048
N=10
PHP: 0.092
Ruby: 0.138
Go: 0.006
#!/usr/bin/php
<?php
$iterations = $argv[1] ? $argv[1] : 1;
$file = "rand.txt";
$dat = file_get_contents($file);
$dat = getHash($dat, $iterations);
echo $dat . "\n";