Skip to content

Instantly share code, notes, and snippets.

View rplugge's full-sized avatar

Robert Plugge rplugge

View GitHub Profile
@rplugge
rplugge / questions-workflow-tools.md
Last active September 29, 2015 17:23 — forked from TessaGit/questions-workflow-tools.md
Workflow Tools Engineer Gist for Robert

Workflow Tools Engineer Screener

Thanks again for applying to the Workflow Tools Engineer job at GitHub! The purpose of this gist is to get a better sense of your technical skills and overall communication style.

Engineers at GitHub communicate primarily in written form, via GitHub Issues and Pull Requests. We expect our engineers to communicate clearly and effectively; they should be able to concisely express both their ideas as well as complex technical concepts.

@rplugge
rplugge / app.rb
Last active August 29, 2015 14:22
Database - Books
require "sqlite3"
require_relative "book.rb"
require_relative "genre.rb"
require_relative "location.rb"
require_relative "module.rb"
require_relative "instance_module.rb"
CONNECTION = SQLite3::Database.new("inventory.db")
CONNECTION.execute("CREATE TABLE IF NOT EXISTS books (id INTEGER PRIMARY KEY, name TEXT NOT NULL, genre_id INTEGER NOT NULL, location_id INTEGER NOT NULL, quantity INTEGER NOT NULL, FOREIGN KEY(location_id) REFERENCES locations(id), FOREIGN KEY(genre_id) REFERENCES genres(id));")
@rplugge
rplugge / app.rb
Last active August 29, 2015 14:22
CheckSplitter With Driver app and SQL
require_relative "check_splitter_sql.rb"
puts "Would you like to add an event?"
answer= gets.chomp.downcase
while answer != "no"
puts "\n How much was the meal?"
meal_cost = gets.chomp
puts "\n How much did you tip?"
@rplugge
rplugge / check_splitter.rb
Created June 9, 2015 19:14
Check_Splitter Test
class Checksplitter
#writing a getter method
attr_reader :meal_cost, :tip_percentage, :number_of_people
def initialize(meal_cost, tip_percentage, number_of_people)
@meal_cost = meal_cost.to_f
@tip_percentage = tip_percentage.to_f
@number_of_people = number_of_people.to_i
end

#Rock-Paper-Scissors

(Entire File found here - https://gist.github.com/rplugge/06eb82a4ccca45b7ca31)

I needed to build a Rock-Paper-Scissors program that could put 2 people against each other or 1 player and a computer.

PlayerClass

The player class is simple, it stores 3 variables

@rplugge
rplugge / check_splitter_test.rb
Created June 9, 2015 16:59
Checksplitter Test
require "minitest/autorun"
require_relative "check_splitter.rb"
class CheckSplitterTest < Minitest::Test
# Should initialize with 3 arguements (meal_cost, tip_percentage, number_of_people)
# meal_cost & tip_percentage should be floats.
# number_of_people should be an integer.
# tip should divide tip_percentage by 100 to get the decimal percentage
# should multiply that by mealcost
@rplugge
rplugge / app.rb
Created June 9, 2015 16:45
Re-Wrote Rock-Paper-Scissors to better adhere by SRP and DRY
require_relative "player_class.rb"
require_relative "game_class.rb"
# Creates new player classes and a game class for this current game
player1 = Player.new
player2 = Player.new
this_game = Game.new
# Gathers information for player names and how many rounds will be played in the game.
@rplugge
rplugge / phone_splitter.rb
Created June 8, 2015 19:29
Mini-projects
class PhoneSplitter
attr_reader :number_array
def initialize(number)
@number = number
@number_array = []
end
# - Checks to see if the number provided is proper length.
@rplugge
rplugge / app.rb
Created June 8, 2015 02:22
Added Computer AI elements
require_relative "player_class.rb"
require_relative "game_class.rb"
# This driver just collects initial information
# (player names, first moves, and creates a new game Class and new player classes.
answers = ["Rock", "Paper", "Scissors"]
puts "Play to best of? (1, 3, 5)"
best_of = gets.chomp.to_i
@rplugge
rplugge / app.rb
Created June 5, 2015 18:50
Rock Paper Scissors - Level 2
require_relative "player_class.rb"
require_relative "game_class.rb"
answers = ["Rock", "Paper", "Scissors"]
puts "Play to best of? (1, 3, 5)"
best_of = gets.chomp.to_i
puts "Let's play some Rock, Paper, Scissors!"
puts "\n Player 1, what is your name?"