Skip to content

Instantly share code, notes, and snippets.

function BankAccount(ownerName, begBalance) {
var accountNumber = new Date().getTime() + '';
this.ownerName = ownerName;
this.balance = begBalance;
this.getAccountNumber = function() { return accountNumber; };
}
BankAccount.prototype.deposit = function(amount) {
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
hippos = Hippo.create(
[{name:"Peter the Hippo",age:29,weight:2334,price:947.59},
@jim-clark
jim-clark / agile.md
Last active December 11, 2020 19:40

Agile Development & Trello


Agile Development & Trello

Intro to Node.js

Learning Objectives
Understand What Node.js Is
Use Node.js to Execute JavaScript
Use Node.js as a Basic Web Server

Intro to MongoDB

Learning Objectives
Explain What MongoDB Is
Save and Retrieve MongoDB Documents
Model Data using Embedding & Referencing

Roadmap

Our First MEAN Stack Application


Learning Objectives


  • Create a basic Node.js app using the Express framework
angular.module('hipposApp', [])
.controller('HomeController', HomeController);
function HomeController($scope, $http) {
$http.get('/api/hippos')
.success(function(data) {
$scope.hippos = data;
@jim-clark
jim-clark / node_socketio.md
Last active August 29, 2015 14:24
MEAN with Socket.IO

Adding Realtime to our MEAN Stack Application


Learning Objectives


  • Add realtime event-based communication between client and server in a MEAN Stack app
@jim-clark
jim-clark / index.html
Last active August 29, 2015 14:24
Code for MEAN with Socket.IO
<!-- Add this HTML to the end of the existing HTML, just above the Socket.IO script. -->
<hr>
<div class="row">
<div class="col-xs-4">
<h4>Hippo Live Chat</h4>
</div>
<div class="col-xs-8 text-right">
<label>Your Name:</label> <input type="text" ng-model="username">&nbsp;&nbsp;
<button ng-click="sendMsg()" class="btn btn-success">Send Message</button>