Skip to content

Instantly share code, notes, and snippets.

View brettsanders's full-sized avatar

Brett brettsanders

  • Requis
  • San Diego
View GitHub Profile
############################
# INPUT
############################
# array
rolls = "6 2 7 1 10 9 0 8 2 10 10 3 5 7 2 5 5 8 0".split(" ").map{|num| num.to_i}
############################
# PROCESS data_for_display
############################
@brettsanders
brettsanders / zoo.js
Last active December 20, 2015 05:49 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
function Animal(name,leg_count) {
this.name = name;
this.leg_count = leg_count;
}
Animal.prototype.identify = function(){
@brettsanders
brettsanders / index.html
Last active December 20, 2015 05:39 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
# puts "/Users/apprentice/Dropbox/DBC-Chicago/Grasshoppers/brettsanders/week_2/\
# wednesday/p5_oo_inheritance.rb"
# puts "- - - - - - - - -"
class Car
@@WHEELS = 4
def initialize(args)
@color = args[:color]
@wheels = @@WHEELS
end
# Determine whether a string contains a Social Security number.
def has_ssn?(string)
string =~ /\d{3}-\d{2}-\d{4}/
end
# Return the Social Security number from a string.
def grab_ssn(string)
grab_all_ssns(string).first
end
@brettsanders
brettsanders / guessing_game.rb
Created May 14, 2013 18:56
guessing game dbc exercise
class GuessingGame
def initialize(guess)
@answer = rand(guess)
@guess = nil
end
def solved?
@guess == @answer
end
@brettsanders
brettsanders / application.css
Created April 19, 2013 18:29
intermediate rails css stylesheet look like thoughtbot homepage
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
@brettsanders
brettsanders / LivingSocialApplication.markdown
Created January 9, 2012 01:29
Fundamental Jazz Music Theory : The Two Five One (ii V I) Pattern

Fundamental Jazz Music Theory :
The Two Five One (ii V I) Pattern

by Brett Sanders

Jazz music SOUNDS and APPEARS very complicated. However, 75% of fundamental Jazz undertanding AND improv is guided by a single theoretical rule:


ii V I