- Scopes in JS
- Context (aka
this
) in JS - Callbacks Review
- NodeJS Modules
- NodeJS Automated Testing w. Mocha - time permits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x69b8Fb504E2eb0B2A8B6e5C1caF4ce6070c76BDB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************** | |
Example 1: we can store a function like we store any other value. | |
In the example below, the function we are storing in `sumArray` is actually unnamed | |
which is to say it's an "annonymous" function. | |
**********************************************************************/ | |
var sumArray = function(arr){ | |
return arr.reduce(function(sum, elm){ | |
return sum += elm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Working with multiple stocks | |
""" | |
SPY is used for reference - it's the market | |
Normalize by the first day's price to plot on "equal footing" | |
""" | |
import os | |
import pandas as pd | |
import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './bartender.rb' | |
require './restaurant.rb' | |
require './review.rb' | |
describe Bartender do | |
before :each do | |
@bartender = Bartender.new('John', 6) | |
end | |
describe '.new' do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee < ActiveRecord::Base | |
BILLABLE_HOURS = 1950 | |
belongs_to :store | |
validates :first_name, :last_name, | |
presence: true | |
after_create :increment_employees_count | |
after_destroy :decrement_employees_count |
In the code below, is person is an Object or Class or Constructor? What's the difference ?
function Person(name,age) {
this.name = name;
this.age = age;
}
// a function that prints the name of any given person
var printPersonName = function (p) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cellphone < Product | |
def initialize(name, price, brand) | |
super | |
end | |
end |