Skip to content

Instantly share code, notes, and snippets.

container_commands:
sync_db:
command: "docker run --env DATABASE_URL=`/opt/elasticbeanstalk/bin/get-config environment | jq -r .DATABASE_URL` aws_beanstalk/current-app:latest lein lobos migrate"
leader_only: true
@toothrot
toothrot / git-cleanup.sh
Last active January 27, 2016 19:05
Clean up branches that have been merged into master
#!/bin/sh
set -e
if test -d .git
then
git fetch
git checkout master
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
git remote prune origin
git checkout -
fi
characters = ["astro.png",
"banyan.png",
"bear.png",
"bird.png",
"chillanna.png",
"cupcake.png",
"dino.png",
"frog.png",
"gorilla.png",
"monkey.png",
@toothrot
toothrot / gist:36eb1451e2e9589f7f8b
Created March 18, 2015 20:02
Exercise: Fibonacci Closure
//https://tour.golang.org/moretypes/22
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
a := 0
b := 1
// https://tour.golang.org/moretypes/19
package main
import (
"golang.org/x/tour/wc"
)
import "strings"
func WordCount(s string) map[string]int {
counts := make(map[string]int)
// https://tour.golang.org/moretypes/14
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
mything := make([][]uint8, dy)
for i := 0; i < dy; i++ {
mything[i] = make([]uint8, dx)
}
abc = "abc" "#{abc}"
#=> "abc"
abc = "abc" "#{abc}"
#=> "abcabc"
String.send(:define_method, :call) { |*a| self.concat(*a) }
"abc" "abc". ("abc"). ("abc")
#=> "abcabcabcabc"
commit 048f2266fa4941257cc5650831fc477bff4d2a94
Author: Alexander Rakoczy <alex@kitchensurfing.com>
Date: Mon Jan 5 13:45:40 2015 -0500
See you in 5 years
diff --git a/spec/mailers/request_mailer_spec.rb b/spec/mailers/request_mailer_spec.rb
index 8a9bfd2..f8fbaad 100644
--- a/spec/mailers/request_mailer_spec.rb
+++ b/spec/mailers/request_mailer_spec.rb

Keybase proof

I hereby claim:

  • I am toothrot on github.
  • I am rock (https://keybase.io/rock) on keybase.
  • I have a public key whose fingerprint is 16C2 32CC 45AD D901 6D00 55F3 401E A3D6 A3DC E5FA

To claim this, I am signing this object:

@toothrot
toothrot / corn
Created April 1, 2013 14:42
Best part of the morning
$ corn
.-'"`/\
// /' /\`\
('//.-'/`-.;
\ \ / /-.
__.__.___..__._.___.\\ \\----,_
.:{@&#,&#@&,@&#&&,#&@#&@&\\` \-. .-'-.
.:{@#@,#@&#,@#&&#,@&#&@&,&@#&&\\, -._,"- \
.{#@#&@#@#&#&@&#@#@&#,@#@#&@&&#@#\ \// = \`=\__
`{#@,@#&@&,@&#@,#@&#@#&@#&@,&#@,#/\/ =`-. -_=__