Skip to content

Instantly share code, notes, and snippets.

View wvwatson's full-sized avatar

wwatson wvwatson

View GitHub Profile
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def test_email
@recipients = "someone@somewhere.com"
@from = "must_be_same_as_smpt_account_login@gmail.com"
@subject = "test from the Rails Console"
@body = "This is a test email"
end
end
@mepatterson
mepatterson / gist:5702783
Last active December 18, 2015 01:19
examples from my presentation on building a game industry Unlocks system with Goliath and Grape
# ====== TODAY'S KATA:
# * create an Achievements API
# * create an Achievement model, a User model, and a db table for many-many relationship between the two
# * now, write the Goliath+Grape code to create 3 endpoints:
# * 1. an endpoint to SHOW an Achievement (GET /v1/achievements/1)
# * 2. an endpoint to SHOW a User (GET /v1/users/1)
# * 3. an endpoint to GRANT an Achievement to a user (???)
# EXAMPLE GEMFILE THAT SHOULD WORK:
@sfate
sfate / vim-on-heroku.sh
Created June 7, 2012 14:39 — forked from naaman/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@coreyhaines
coreyhaines / .rspec
Last active August 15, 2024 15:13
Active Record Spec Helper - Loading just active record
--colour
-I app
@juniorz
juniorz / install_postgis_osx.sh
Created July 14, 2011 03:49
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@ramontayag
ramontayag / pairprogramming.screenrc
Created June 24, 2011 18:03
.screenrc setting for remote pairing
multiuser on
acladd user1,user2,user3
vbell off
hardstatus string "%1`"
# change the hardstatus settings to give an window list at the bottom of
# the screen, with the time and date and with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'