Skip to content

Instantly share code, notes, and snippets.

View blaisethomas's full-sized avatar

Blaise Thomas blaisethomas

  • @vertebrae-org
  • Los Angeles
View GitHub Profile
Ruby is a CLASS based, OBJECT oriented language. Every _______ is an instance of a _______.
Ruby sees everything, from simple values (strings, integers), to complex data structures (arrays), as _________.
Ruby OBJECTS are most often handled via ________ that represent them.
Every OBJECT is capable of understanding a certain set of MESSAGES.
These MESSAGES correspond directly to a _________ - a named, executable routine, whose execution the object has the ability to trigger.
@blaisethomas
blaisethomas / quiz.md
Last active August 29, 2015 14:16
week9day1quiz

Ruby sees everything, from simple values (strings, integers), to complex data structures (arrays), as [Question 2]

Ruby is a [QUESTION 1] based, object oriented language. Every [Question 2] is an instance of a [QUESTION 1].

Ruby objects are most often handled via [Question 3] that represent them.

Every object is capable of understanding a certain set of messages.

These messages correspond directly to a [Question 4] - a named executable routine, whose execution the object has the ability to trigger.

@blaisethomas
blaisethomas / w8d4_answers.md
Last active August 29, 2015 14:16
Week 8 Day 4 Answers:

Q - How is D3 different from user interaction manipulating DOM elements?

A - the DOM is manipulated by data

Q - how do I add D3 to my app?

A - minified file, CDN, unminified (we did <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> in class)

Q - Assuming a model and controller exist, where would I write a custom helper method that is available application wide?

@blaisethomas
blaisethomas / expect.rb
Created March 3, 2015 19:38
expect matchers
Object identity
expect(actual).to be(expected) # passes if actual.equal?(expected)
Object equivalence
expect(actual).to eq(expected) # passes if actual == expected
Comparisons
expect(actual).to be > expected
expect(actual).to be >= expected

###Q1 // Create a new Rails application called model_tdd. Add rspec_rails to the Gemfile. Install RSpec.

$ rails new model_tdd

# Gemfile
group :development, :test do
  gem "rspec-rails"
end

$ bundle exec rails generate rspec:install

Intro to Postgres v.2 (with psql and heroku commands)

This file will show you how to install a rails4 app Installation: Step 1 - download the postgresapp control+click to install it in your applications folder go to your terminal or iterm2 command line prompt and type... psql postgres

@blaisethomas
blaisethomas / gist:f5f4c4a104804e5c80e0
Created February 3, 2015 06:57
Q2 // What is the output ?
class Car
attr_accessor :color
def speed
speeda = 100;
end
def print_speed
puts @speeda
end
Consider this code being found in the controller:
$scope.stuff = ["a", "b", "c", "d"];
$scope.changeIt = function(idx) {
$scope.stuff[idx] = "x";
};
And this unordered list on the page:
<ul>
<!DOCTYPE html>
<html ng-app="toyStore">
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body class="container" ng-controller="StoreController as store">
<div class="product row" ng-hide= store.product.soldOut>
<h3>