Skip to content

Instantly share code, notes, and snippets.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC9ZlKMCD3twyy+j602F6EdiZ4YjZ3c/tNYskgWvneTMTvKnQnxUkiyR+nnq9MAaKxRWZbF3Rt72/gzXEWRXajSEdQAI3P9Lo3pZ26NmgDsYqPw7+T3iDbQCRcGBA+9Ydktd/m73zOcQ2uatkCVOmUYnx3tv4ZwzjKHW8g4yj9CE+N2rIVx0Te1FZmJhM7waQfhmp6J+ZpeB69X1YRw63tVepiaLKzuNEPWwYgqyuOvs6BiNaIyImi6xbVDkeYScvZf5B+RWMot4WUaZLqZPZ/AtssEprOT0jFQLO1Gb5UKDDQ68edW2nS9ujwJ1lFbkzUzG3nWOz3cHApiIfILEIfYfkgrqpqwKsKh1HhxfBMKa/Zb46qtG1qUjn3JfKJGgZtmkKpRlFsyuV/PK/FTPGTba2SJ5Aan8zzSC5uP1B05ISVCfJmICG7nWKqkyvEzEVe9f2VTb96d8SDyPFKxjqxJVz9OyeKoZ1xEkXauLEERF9+l6zMct1TPCsWKEg2bPeLAVetAONrRYGjyJFNXRqivkSOUraJGsxqAxFg1+hcu0jSo1zO44Gv8GFO2D54WlyqV8qTzM9b5xBo0SDHP8JqHlYFpFNQoy9cm3yL27UC+eSRwdrrBZACixDo4wysGbCjJSi7buvMLsQ4Y/0tBixHxuCGbELgC9DVu95MVzvTLVw== openpgp:0x19C03395
@coop
coop / key.asc
Last active June 12, 2017 01:27
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFjxghsBEACiDVnS3ofjwxJ2tH3nTYnm0JhADfcFACl9Ij/dY61PbEIH8bsA
nY7+Iii0S2cE/pveQVeVsI9ERKaiL9HFN2mqn84FRKYTHxclmY4oyPIpPbRuB+Es
umQyG1e5VGXwUyy0NHkwfqhMyCQK9hclRx/pYYZZ7KTOa6pSo36gLhw2NLRF8EZt
CFHFwKzlj4Q4gtfBjNs9BQL7LcJekOlo7omqRUHl+2qTUUPcMmNyWseOE+eR5qfZ
mrABTic2bX6NnrX9pFM3Na7g6mp877Uec7cNI+szhwLePOwJI7twU93blcbEkV+X
5BzSU5zkSEBPfnClAmXjXdt8TykrhptAIPEGw+yAxR8gdZzUr8DkdFaFxWZy9qqx
eyVzErzOzr5rZ+ub8B78YIlbeN9iMvGPp0ed0h1SITu1f0F1wAFeLITREe9DN7OS
3csC7MEChgN2zurGNEkpWhFguklHzVTTmpyXaUOWCz7APWuRBdglPo0damKEM/zS

Keybase proof

I hereby claim:

  • I am coop on github.
  • I am timcooper (https://keybase.io/timcooper) on keybase.
  • I have a public key ASATXZRBfzGXFP9ohhbPeN_EW0yDqJqgDn75g_9sYp-YyAo

To claim this, I am signing this object:

Inferring Schemas From Structs

This is a really quick and dirty example of how you can infer a form schema from a dry-type Struct or Value and how you might use it in a HTTP controller.

@coop
coop / README.md
Last active August 29, 2015 14:25

PG Notify Example

$ createdb pg_notify
$ ruby publisher.rb
@coop
coop / ci
Created October 17, 2014 11:47
~$ cat bin/ci
#!/bin/sh
APP=$(basename $(git rev-parse --show-toplevel))
BASE_URL="https://semaphoreapp.com/everydayherodev/$APP/branches"
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
BRANCH_URL=$(echo $CURRENT_BRANCH | sed -e "s/\//-/g")
URL="$BASE_URL/$BRANCH_URL"
$(open "$URL")
# config/initializers/env_vars_set.rb
Dotenv::Parser.call(File.read(Rails.root.join(".env"))).each { |(key, _)| ENV.fetch(key) }
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
class Donation
def move_donation new_page
raise CannotMoveError if charity != new_page.charity
send_event :donation_moved, from_page_id: page.id, to_page_id: new_page.id
end
end
@coop
coop / donations.js
Last active December 27, 2015 03:49
//= require jquery.payment
jQuery(function($) {
var $form = $('form#donation-form'),
$submit = $('input[type=submit]', $form);
// Fields can be invalid in two ways:
//
// * do not contain a value
// * fail $.payment checks