This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.describe 'Player can view their own hand and the decks visible card' do | |
let(:game) { Game.new(2) } | |
subject(:player) { game.players[0] } | |
let(:deck) { game.deck } | |
it "can see visible card" do | |
expect(player.see_visible).to be_a(Card) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_change(initial_cents=0) | |
remaining_cents = initial_cents | |
currency = { | |
# values are in num cents | |
"penny" => 1, | |
"nickel" => 5, | |
"dime" => 10, | |
"quarter" => 25, | |
"1 dollar" => 100, | |
"5 dollar" => 500, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notes from http://www.learnshell.org/ | |
--------------------------------------------- | |
Interpreter name - | |
ps | grep $$ | |
(assumed to be "bash") | |
Interpreter path - | |
which bash | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unfortunately, I broke the screen on my Chromebook by getting a twig stuck between the keyboard and the display and closing it when going to sleep in my tent in Eugene. | |
Here are the specs of my new computer, which I bought at the Goodwill computer store here for $169.99 | |
Operating System | |
MS Windows 7 Home Premium 64-bit SP1 | |
CPU | |
Intel Mobile Core 2 Duo T6500 @ 2.10GHz 60 °C | |
Penryn 45nm Technology | |
RAM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WeightFormatter | |
class << self | |
def format_weight(items) | |
# formats weights, prints new weights, and prints max & min weights | |
formatted = to_k_format(items) | |
print_weights(formatted) | |
print_max_and_min(formatted) | |
end | |
def to_k_format(items) | |
# converts "l"-formatted items to "c" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function send_email { | |
curl --url "smtps://smtp.gmail.com:465" --ssl-reqd \ | |
--mail-from "[email protected]" --mail-rcpt "$1" \ | |
--upload-file $2 --user "[email protected]:$GMAIL_PASSWORD" --insecure | |
} | |
# replace symbolic.contrast with your email | |
# and export GMAIL_PASSWORD | |
# command line options are <recipient> <mail file> | |
# i.e. send_email [email protected] mail.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Makes CRUD routes for a resource. | |
Credit goes to http://code.tutsplus.com/tutorials/building-single-page-web-apps-with-sinatra-part-1--net-27911 | |
for the CRUD code. I added the sublime snippet variables and edited / built on it. | |
The tab stops will set the variables. | |
1. is for plural lowercase | |
2. is for singular lowercase | |
3. is for singular Capitalized (i.e. ClassName) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple 16 step drum machine experiment with Node and CoffeeScript | |
# by Peter Cooper - @peterc | |
# | |
# Inspired by Giles Bowkett's screencast at | |
# http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html | |
# | |
# Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ | |
# | |
# Required: | |
# node, npm and coffee-script installed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
// show folder in sidebar | |
{ "keys": ["ctrl+alt+o"], "command": "prompt_add_folder" }, | |
// add folder to project | |
{ "keys": ["ctrl+alt+o"], "command": "prompt_add_folder" }, | |
// remove folder from project | |
{ "keys": ["ctrl+alt+r"], "command": "close_folder_list" }, |