Skip to content

Instantly share code, notes, and snippets.

View petemmitchell's full-sized avatar

Pete Mitchell petemmitchell

View GitHub Profile
Scope: Defines where a specific bit of code to be run is available.
Controller: Adds or changes behaviors within the scope
Data binding: Synchronizes data instantly between model and view (2 way)
Dependency injection: Deals with how components, controllers, and modules get their dependencies.
Directive: Attaches logic or components of the view to the DOM
Module: Contain packages of code, like namespace
@petemmitchell
petemmitchell / foundation_error
Created September 21, 2014 04:56
Error with new Foundation theme
ActionController::RoutingError: No route matches [GET] "/fonts/raleway/Raleway-Regular.woff"
@petemmitchell
petemmitchell / domain_ping
Created September 19, 2014 01:58
My new domain
~/P/p/portfolio dev ✔ host www.petemmitchell.com
~/P/p/portfolio dev ✔ dig www.petemmitchell.com
; <<>> DiG 9.8.3-P1 <<>> www.petemmitchell.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62615
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
@petemmitchell
petemmitchell / usaWins.html
Created June 11, 2014 03:55
Racing Game (Using object builder)
<script>
var usa, ghana, portugal, germany, miles;
function Racer(name, speed, intelligence, luck) {
this.name = name;
this.speed = speed;
this.intelligence = intelligence;
this.luck = luck;
this.position = 0;
this.race = function() {
@petemmitchell
petemmitchell / guessing2.html
Created June 9, 2014 00:58
CodeFellows F1: Project 2 (Guessing game w/ For loop)
<script>
var answer;
var guessingGame = function(answer) {
var guess, difference;
guess = prompt("I'm thinking of a number between 1 & 20. Can you guess what it is?")
difference = Math.abs(guess - answer)
if(guess == answer) {
alert("You win a new car!")
return;
}