Skip to content

Instantly share code, notes, and snippets.

View mcsuth's full-sized avatar

Seimith Suth mcsuth

View GitHub Profile
# Building Ruby Familiarity
# In this exercise you will take a first look at some common commands in Ruby
# The idea here is to build familiary with Ruby syntax
# This will likely be the first time you've seen some of these commands
# Just type them in and see the displayed output
# Steps:
# 1. Open up a new terminal window
# 2. Launch irb
# User list holds a list of names
# and their shopping items
# Expecting [name, [item1, item2]] style
user_list = []
# Prompting the user if they want to start
puts "Would you like to start a nested list?[y/n]"
response = gets.chomp
my_hash = {"jackie"=>"I like bowling", "Luke"=>"likes riding his bike", "imogen"=>"I have a cold", "sara"=>"I ride bart"}
puts "Want to start a hash?"
response = gets.chomp
while response == "y"
puts "Give us your name"
key = gets.chomp
puts "would you lke to start a contact list?"
response = gets.chomp
hash = {}
while response == "y"
puts "give me name"
name = gets.chomp
puts "number"
number = gets.chomp
hash[name] = number
@mcsuth
mcsuth / gist:6735018
Last active December 24, 2015 03:09 — forked from featherart/gist:6734826
Boo
# ,o888888o. 8 8888 88 8 8888 8888888888',8888'
# . 8888 `88. 8 8888 88 8 8888 ,8',8888'
# ,8 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8. 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8,8P 8 8888 88 8 8888 ,8',8888'
# `8 8888 ;8P ` 8888 ,8P 8 8888 ,8',8888'
# ` 8888 ,88'8. 8888 ,d8P 8 8888 ,8',8888'
require './bowling'
describe Bowling do
describe '#score' do
let(:game) { Bowling.new }
it 'should start at 0' do
game.score.should == 0
end
class Bowling
attr_reader :score
def initialize
@score = 0
@spare = 0
@turn = 0
@strike = 0
@pins_this_frame = 0
@mcsuth
mcsuth / rock.js
Created October 2, 2013 22:39 — forked from WizardNinja/rock.js
// Generated by CoffeeScript 1.6.3
var userName;
var intervalSet = false;
function touchRock() {
if (userName === undefined ) {
userName = prompt("What is your name?");
alert("It's nice to meet you " + userName);
document.getElementById("rockImg").src = "rock2.jpeg";
}
<html>
<head>
<title>Supersize Me Cookie</title>
</head>
<body>
<button href="#" onclick="myStopFunction();">stop the cookie!</button>
<br>
<img name="fred" id="freddie" src="cookie.jpg" width="100" height="auto">
@mcsuth
mcsuth / atm.css
Created October 3, 2013 17:08 — forked from WizardNinja/atm.css
@import url(http://fonts.googleapis.com/css?family=Oleo+Script);
@import url(http://fonts.googleapis.com/css?family=Ruluko);
#content {
margin: 0 auto;
text-align: center;
width: 700px;
}
#nav {