$ git checkout develop
$ git pull origin develop
$ git checkout master
$ git merge develop
$ git push origin master
Jack and Jill are working on a feature together. Jack has pushed to the feature branch on github. Before Jill pushes her changes, she needs to fetch and rebase her changes over Jack's.
git fetch
git rebase //replay Jill's commits over Jack's
gss (list files with conflicts)
>> go to atom and fix the conflicts
git add <file-with-conflicts.js> or git add .
git rebase --continue (continue with rebase)
gss (check there are no conflicts)
sudo lsof -i :3000
kill -9 <PID>
- Create a private key file, from which you can create the manifest key and Application ID, as detailed here: https://stackoverflow.com/questions/23873623/obtaining-chrome-extension-id-for-development
- Add the manifest key to "key" in manifest.json
- Create a new project in Google Developer Console https://console.developers.google.com/project
- Go to "APIs & auth > Credentials" and create new client id for a Chrome Application using the Application ID generated in step 3.
- Copy the Client ID to oauth2.client_id in the manifest.json
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
const fetchFromGithub = async (endpoint) => { | |
const url = `https://api.github.com/users/${endpoint}` | |
const response = await fetch(url) | |
return await response.json() | |
} | |
const getGithubUserInfo = async (handle) => { | |
return await Promise.all([ | |
fetchFromGithub(handle), | |
fetchFromGithub(`${handle}/repos`) |
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
//contrived example creating a delayed function and a function that returns a promise where the delayed functio is resolved. | |
const delay = (cb) => { | |
setTimeout(() => { | |
cb('delay over') | |
}, 2000); | |
} | |
const promiseDelay = new Promise((resolve, reject) => { | |
delay((message)=>{ |
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
const fetchGithubUser = async (handle) => { | |
const url =`https://api.github.com/users/${handle}` | |
const response = await fetch(url) | |
const body = await response.json() | |
if (response.status !== 200) { | |
throw Error(body.message) | |
} | |
return body | |
} |
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
let a = 1 | |
let b = 2 | |
b = [a, a=b][0] | |
console.log(a)//2 | |
console.log(b)//1 |
INSTALL
brew install mysql
//Homebrew installs MySQL database without a root password
START PROCESS
mysql.server start
mysql -u root -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
var mysql = require('mysql'); | |
var connection = mysql.createConnection({ | |
host : 'localhost', | |
user : 'root', | |
password : '', | |
database : 'myLibrary', | |
}); | |
connection.connect(function (err) { |