This file contains 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
christophersair:~ Chris$ git --version | |
git version 1.8.5.2 (Apple Git-48) | |
christophersair:~ Chris$ which git | |
/usr/bin/git | |
christophersair:~ Chris$ |
This file contains 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
#Psuedo code | |
#Draw a playing field | |
# Get input from the player for an X to go in spaces #1-9 | |
# Store input in a Hash with spaces #1-9 and either X or O??? | |
# Map puts lines to each section of chart? | |
# Place X in space input by player | |
# Place O in a space not yet used by player | |
# Keep past choices displayed and ask user for another input (????) | |
# Keep going until player or computer has 3 marks in a row (Payer/Computer wins) | |
# OR board is filled (Tie) |
This file contains 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
# blackjack_oop.rb | |
# Requirements | |
# - Dealer has a deck of cards. The cards are shuffled and dealt to the Dealer and Player. The player and dealer calculate their hands. If dealer has 21, game is over. If player has 21, player wins. If both have 21, they tie (push). If neither, play continues | |
# If play continues, player is asked to hit or stay. If player hits, new card is dealt and new caluclation made for <21, ==21 or >21. If <21, player can hit or stay. If ==21, player wins or ties is dealer aslo has 21. If >21 player loses. | |
# If player stays, dealer takes turn. Dealer must hit if <=16, and wil stay at >=17. If dealer, busts, palyer wins. If dealer stays at >= 17 and does not bust, compare score to player. Player with higher score wins. Game resets. | |
# Major nouns: |
This file contains 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
# blackjack_oop.rb | |
# Requirements | |
# - Dealer has a deck of cards. The cards are shuffled and dealt to the Dealer and Player. The player and dealer calculate their hands. If dealer has 21, game is over. If player has 21, player wins. If both have 21, they tie (push). If neither, play continues | |
# If play continues, player is asked to hit or stay. If player hits, new card is dealt and new caluclation made for <21, ==21 or >21. If <21, player can hit or stay. If ==21, player wins or ties is dealer aslo has 21. If >21 player loses. | |
# If player stays, dealer takes turn. Dealer must hit if <=16, and wil stay at >=17. If dealer, busts, palyer wins. If dealer stays at >= 17 and does not bust, compare score to player. Player with higher score wins. Game resets. | |
# Major nouns: |
This file contains 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
In just a few sentences, the message should describe a toaster (the kitchen appliance) in the terminology of a programming method. | |
What is/are its expected argument(s)? | |
- The toaster method should accept any toastable food as arguments (bread, bagle, pop-tarts) | |
What does it return? | |
- The Toaster method should return it's arguments that have been toasted, or heated until crispy but not burnt. | |
What are its side effects? | |
- Side effects include electricity used, heat produced, and time taken |
This file contains 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
# Downcase everything to normalize | |
# | |
require 'pry' | |
class Title | |
attr_accessor :string | |
def initialize(string) |
This file contains 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 create | |
@topic = Topic.new(topics_params) | |
authorize @topic | |
if @topic.save | |
redirect_to @topic, notice: "Topic was saved successfully." | |
else | |
flash[:error] = "Error creating topic. Please try again." | |
render :new | |
end | |
end |
This file contains 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
create_table "users", force: true do |t| | |
t.string "name" | |
t.string "email", default: "", null: false | |
t.string "encrypted_password", default: "", null: false | |
t.string "reset_password_token" | |
t.datetime "reset_password_sent_at" | |
t.datetime "remember_created_at" | |
t.integer "sign_in_count", default: 0, null: false | |
t.datetime "current_sign_in_at" | |
t.datetime "last_sign_in_at" |
This file contains 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
# This interceptor just makes sure that local mail | |
# only emails you. | |
# http://edgeguides.rubyonrails.org/action_mailer_basics.html#intercepting-emails | |
class DevelopmentMailInterceptor | |
def self.delivering_email(message) | |
message.to = '[email protected]' | |
message.cc = nil | |
message.bcc = nil | |
end | |
end |
This file contains 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
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Booting WEBrick | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Rails 4.2.0 application starting in production on http://0.0.0.0:59955 | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Run `rails server -h` for more startup options | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: => Ctrl-C to shutdown server | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: Started POST "/incoming" for 173.203.37.137 at 2015-02-01 20:21:34 +0000 | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: User Load (15.6ms) SELECT "users".* FROM "users" WHERE ([email protected]) LIMIT 1 | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: Processing by IncomingController#create as */* | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: PG::UndefinedTable: ERROR: relation "users" does not exist | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: LINE 1: SELECT "users".* FROM "users" WHERE ([email protected]) LIMI... | |
Feb 01 12:21:35 blocmarks-ckib16 app/web.1: ^ |
OlderNewer