Skip to content

Instantly share code, notes, and snippets.

View FaisalAl-Tameemi's full-sized avatar

Faisal Al Tameemi FaisalAl-Tameemi

View GitHub Profile
@FaisalAl-Tameemi
FaisalAl-Tameemi / employee.rb
Last active August 4, 2016 21:36
ORM Breakout Notes
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
require './bartender.rb'
require './restaurant.rb'
require './review.rb'
describe Bartender do
before :each do
@bartender = Bartender.new('John', 6)
end
describe '.new' do
@FaisalAl-Tameemi
FaisalAl-Tameemi / http.md
Created August 8, 2016 02:10
Intro To HTTP Notes

Introduction to HTTP

Starting from the top...

@FaisalAl-Tameemi
FaisalAl-Tameemi / 01-02.py
Created September 18, 2016 22:18 — forked from dimi-tree/01-02.py
Udacity: Machine Learning for Trading
# 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
@FaisalAl-Tameemi
FaisalAl-Tameemi / README.md
Last active September 19, 2016 17:14
CSS Box Model

CSS Box Model

Quick Review - CSS Syntax

Let's quickly review some of the basic syntax and anatomy of CSS code.

If we wanted to style all the divs on a given page with a height and width of 400px as well as a blue background, then our CSS code could be as follows:

@FaisalAl-Tameemi
FaisalAl-Tameemi / 01_functions_are_values.js
Last active October 6, 2016 21:38
Callbacks / Higher Order Functions Examples.
/**********************************************************************
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;
@FaisalAl-Tameemi
FaisalAl-Tameemi / 00-js-foundations.md
Last active October 7, 2016 14:07
JS Fundamentals Review + NodeJS Modules Review / Examples.

JS Foundations

Topics:

  • Scopes in JS
  • Context (aka this) in JS
  • Callbacks Review
  • NodeJS Modules
  • NodeJS Automated Testing w. Mocha - time permits
0x69b8Fb504E2eb0B2A8B6e5C1caF4ce6070c76BDB
@FaisalAl-Tameemi
FaisalAl-Tameemi / erc721-example.sol
Created April 21, 2018 20:56 — forked from aunyks/erc721-example.sol
My implementation of the ERC721 token standard. WARNING: THIS CODE IS FOR EDUCATIONAL PURPOSES. DO NOT DEPLOY TO THE NETWORK.
pragma solidity ^0.4.19;
contract ERC721 {
string constant private tokenName = "My ERC721 Token";
string constant private tokenSymbol = "MET";
uint256 constant private totalTokens = 1000000;
mapping(address => uint) private balances;
mapping(uint256 => address) private tokenOwners;
mapping(uint256 => bool) private tokenExists;
mapping(address => mapping (address => uint256)) private allowed;
mapping(address => mapping(uint256 => uint256)) private ownerTokens;
Neighbourhood Average Listing Price ($) Average Price per Bed ($)
Waterfront Communities-The Island 191.83 124.92
Rosedale-Moore Park 174.61 117.98
Lawrence Park South 168.72 79.51
Bridle Path-Sunnybrook-York Mills 166.33 114.02
Lawrence Park North 164.93 68.55