Skip to content

Instantly share code, notes, and snippets.

View mscoutermarsh's full-sized avatar

Mike Coutermarsh mscoutermarsh

View GitHub Profile
class Pawn < Piece
def first_move?(y)
#Allowed to move 1 or 2 spaces.
if (color: :white && y_position: 1) || (color: :black && y_position: 6)
return true
if (y_position - y) < 3
else
return false
end
end
@mscoutermarsh
mscoutermarsh / 0_reuse_code.js
Created December 30, 2013 20:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env bash
# kill all connections to the postgres server
if [ -n "$1" ] ; then
where="where pg_stat_activity.datname = '$1'"
echo "killing all connections to database '$1'"
else
where="where pg_stat_activity.datname in (select datname from pg_database where datname != 'postgres')"
echo "killing all connections to database"
fi
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def msg
mail(
# Option 2
:from => "mailer@taskk.it",
:to => "coutermarsh.mike@gmail.com",
:subject => "hey dude"
)