Skip to content

Instantly share code, notes, and snippets.

@rhowell
rhowell / foreignkey.go
Created December 31, 2011 18:46
Handling Foreign Key Associations under Google App Engine using GO
package main
import(
"os"
"appengine"
"appengine/datastore"
)
// One-to-One Association
type Boss struct {
@rhowell
rhowell / gist:c3cd20001bcb4475361c
Created May 29, 2014 20:54
VIM & TMux navigation
# .tmux.conf
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# .vimrc
" Move around splits with <c-hjkl>
nnoremap <c-j> <c-w>j
@rhowell
rhowell / FizzBuzz.exs
Last active August 29, 2015 14:23
Fizz Buzz without conditional logic
fizz_buzz = fn
0, 0, _ -> IO.puts "Fizzbuzz"
0, _, _ -> IO.puts "Fizz"
_, 0, _ -> IO.puts "Buzz"
_, _, x -> IO.puts x
end
buzzerator = fn
n -> fizz_buzz.(rem(n, 3), rem(n, 5), n)
end
- s3:
name: generic-unicorn-messages-v2
policy: >
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {