Skip to content

Instantly share code, notes, and snippets.

Installing MongoDB

  • Install Homebrew: http://brew.sh/
  • brew install mongodb
  • sudo mkdir -p /data/db - then type in your password
  • sudo chown $USER /data/db

Start MongoDB Server

  • mongod
@airportyh
airportyh / monkey-patcher.js
Created June 19, 2016 03:51
Monkey-Patcher: a simple monkey patcher with undo. Might be useful for testing.
/*
A quick and dirty monkey-patcher with undo. I made it for testing.
Usage:
var patcher = new MonkeyPatcher();
patcher.patch(Math, 'random', function() {
return 0;
});

AngularJS 1

  • comparison to jQuery - look at Tic Tac Toe app and look at places where we are updating display of the view.
  • MVC
  • data binding
  • directives - AngularJS directives are special HTML attributes that add special behavior to elements
    • ng-click
    • ng-app
    • ng-controller
  • ng-show

Homework

  • reading
  • review your work today and explain to yourself what every line of code does
  • ask 10 questions and write them down in your notebook
    • things you are curious about
    • things you feel uncertain about
  • make a 3x3 grid using table layout and then absolute layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Absolute Position</title>
<style>
#box-1 {
top: 0;
left: 0;
position: absolute;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS</title>
<link href="style.css" rel="stylesheet">
</head>
<body>
<h1>CSS</h1>
<p>CSS stands for Cascading Stylesheets, and is used to build web pages along with HTML and JavaScript.</p>
<script src="fib.js"></script>
function fibonacci(n) {
if (n === 1) {
return 1;
} else if (n === 2) {
return 1;
} else {
var n1 = fibonacci(n - 1);
var n2 = fibonacci(n - 2);
return n1 + n2;
}
<script src="fib.js"></script>