Skip to content

Instantly share code, notes, and snippets.

View FaisalAl-Tameemi's full-sized avatar

Faisal Al-Tameemi FaisalAl-Tameemi

View GitHub Profile

Coding Questions

  1. Given an API response which returns a list of transactions, aggregate (sum) the transactions' amounts of a specific type
    • The aggregation function will run either daily or weekly, must return the correct response either way
    • How would you optimize this function?

API Endpoint: https://530a-5-107-84-27.ngrok.io/transactions

  1. Given the same API method above, write a function which returns the counts of each transaction type
@FaisalAl-Tameemi
FaisalAl-Tameemi / benwillcabinets.service
Last active October 29, 2019 01:00
UI Server w. ExpressJS
[Unit]
Description=Ben Will Cabinets
[Service]
ExecStart=/var/www/construction-website/server.js
Restart=always
User=nobody
Group=nogroup
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
@FaisalAl-Tameemi
FaisalAl-Tameemi / build_directory.sh
Last active September 5, 2019 15:12 — forked from naesheim/buildWhenAffected.sh
CircleCi - only build features that has changed
set -e
# latest commit
LATEST_COMMIT=$(git rev-parse HEAD)
# latest commit where path/to/folder1 was changed
FOLDER1_COMMIT=$(git log -1 --format=format:%H --full-diff path/to/folder1)
# latest commit where path/to/folder2 was changed
FOLDER2_COMMIT=$(git log -1 --format=format:%H --full-diff path/to/folder2)
Model Name Training Score Validation Score Test Score
NaiveModel (always predicts mean price) 0.000000 -0.000172 -0.000609
RandomForestRegressor 0.711069 0.487592 0.489714
PLSRegression 0.459397 0.445175 0.432827
LinearRegression 0.534462 0.488490 0.487435
def train_test(df, response_col='price', dummy_na=False, test_size=.3, rand_state=42, plot=False):
#Split into explanatory and response variables
X = df.drop(response_col, axis=1)
y = df[response_col]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=test_size, random_state=rand_state)
lm_model = LinearRegression(normalize=True)
lm_model.fit(X_train, y_train)
Feature Coeffecient Absolute Coeffecient
neighbourhood_Waterfront Communities-The Island 82.96 82.96
neighbourhood_Beechborough-Greenbrook 82.35 82.35
neighbourhood_Bay Street Corridor 66.44 66.44
neighbourhood_Church-Yonge Corridor 64.54 64.54
room_type_Shared room -64.34 64.34
Neighbourhood Average Listing Price ($) Average Price per Bed ($)
Waterfront Communities-The Island 191.83 124.92
Rosedale-Moore Park 174.61 117.98
Niagara 158.23 114.36
Bridle Path-Sunnybrook-York Mills 166.33 114.02
Bay Street Corridor 147.45 107.69
Neighbourhood Listings Count on AirBnB
Waterfront Communities-The Island 3093
Niagara 799
Annex 691
Church-Yonge Corridor 589
Dovercourt-Wallace Emerson-Junction 512
Little Portugal 493
Bay Street Corridor 491
Trinity-Bellwoods 449
Kensington-Chinatown 442
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
@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;