Skip to content

Instantly share code, notes, and snippets.

@foglabs
foglabs / OOP Getter Examp
Created August 29, 2014 16:15
OOP Getter Examp
class Car
def initialize(color, owner, cylinders)
@color = color
@owner = owner
@cylinders = cylinders
end
def color
@color
end
@foglabs
foglabs / guess_the_number.js
Last active August 29, 2015 14:06
Guess Tha Numbah JS
var secretNumber = Math.random()*100;
secretNumber = Math.round(secretNumber);
var name = prompt("What's yo name baby?");
for(i = 0; i < 10; i++) {
var guess = prompt("Enter your guess, baby!");
if(guess == secretNumber) {
@foglabs
foglabs / gist:5c20169e178256285327
Created October 29, 2014 16:57
CSV Parsing Example For Chris
@csvobjects = []
CSV.foreach('example.csv', headers: true) do |row|
@csvobjects << row
end
result = @csvobjects.select { |k,v| k[:email] == "[email protected]" }.first
result[:name]