Skip to content

Instantly share code, notes, and snippets.

View simonhlee97's full-sized avatar
🎯
Focusing

Simon simonhlee97

🎯
Focusing
View GitHub Profile
@simonhlee97
simonhlee97 / confirmTheEnding.js
Created February 9, 2017 07:18
confirmTheEnding created by simonhlee97 - https://repl.it/FdGK/0
function confirmEnding(str, target) {
return str.substr(target.length) === target;
}
confirmEnding("sesame", "same");
// why does the code above return "FALSE"?
// I originally thought, since (-target.length = -4)
// that "does substr(-target.length) === target?" meant does 'same' = the last 4 characters of str? but (-4) is actually an index, so you start at -4th letter, which is 's' and you go to the end, which gives you "same".
/*
function confirmEnding(str, target) {
@simonhlee97
simonhlee97 / day1.txt
Last active August 19, 2017 00:20
1150 Academy - Week 1 - class notes
8/14/2017
** Git Commands **
git status (to check which files are ready to be added)
git add -A (for all files)
git commit -m "Hello World" (commit file to repo)
git log (notes for the file git)
** Design and Technical Wireframes **

Mon 8/28/17
Lab Day

Tue 8/29/17
Lab Day

Wed 8/30/17
Install PostgreSQL

Thu 8/31/17

Try SQL course (from codeschool.com)

SELECT title
FROM movies
WHERE id = 2;

SELECT * FROM movies
WHERE title = 'The Kid';

// Object oriented programming (from Khan Academy)
// 2 object literals
var winstonTeen = {
"nickname": "Winsteen",
"age": 15,
"x": 20,
"y": 50
};
var winstonAdult = {
"nickname": "Mr. Winst-a-lot",
@simonhlee97
simonhlee97 / week4.md
Last active September 10, 2017 13:48

Tuesday:
We worked on our app modules.
Discussed the anatomy of HTTP transaction.
We tested our API endpoints in PostMan and created tables in PostgreSQL
One of the things we learned today: in Sequelize, to define mappings between a model and a table, we use the define method.

Wednesday:
we continued working on our modules
We discussed Routes, bCrypt, and Validation

@simonhlee97
simonhlee97 / JS Prototypes and Inheritance
Last active September 12, 2017 01:23
pluralSight videos
JavaScript Prototypes
What's a Prototype?
Instance vs Prototype Properties
Changing a Function's Prototype
Multiple Levels of Ineritance
@simonhlee97
simonhlee97 / week5.md
Last active September 12, 2017 14:32
notes from Week 5

Monday
to deploy to Heroku:
heroku login git push heroku master

Tuesday

@simonhlee97
simonhlee97 / aug21.md
Last active September 13, 2017 12:10
Week2

if you screw up a branch, go back to master, create a new branch

Create new branch and switch over to new branch: git checkout -b simon-changes

to check currently working branch: git branch

to switch to simon branch: git checkout simon

@simonhlee97
simonhlee97 / forrest.md
Last active September 13, 2017 14:49
workout (running) app notes

To develop locally, from the Master Heroku branch:

  1. Create a new branch.
  2. Make these 3 changes:
    --- in the .env file, add JWT_SECRET='i_am_secret'
    --- in Web/app.js, change var API_BASE = "simonkwondo.herokuapp.com/api/" to ** = 'http://localhost:3000/api/';**
    --- in Server/db.js, change line 2 (var sequelize = ...)