- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/5798930 (
git reset
vsgit rm --cached
)
This file contains 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 dollarFormat = (amount, defaultValue) => { | |
console.log(amount) | |
if (!amount) | |
return defaultValue; | |
const result = `${parseFloat(amount).toFixed(2)}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','); | |
console.log(result) | |
if (isNaN(result)) | |
return defaultValue | |
else |
This file contains 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 dollarFormat = (amount, defaultValue) => { | |
console.log(amount) | |
if (!amount) | |
return defaultValue; | |
const result = `${parseFloat(amount).toFixed(2)}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','); | |
console.log(result) | |
if (isNaN(result)) | |
return defaultValue | |
else |
This file contains 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 uniqSort = function(arr) { | |
const memo = {[arr[0]] : true}; | |
const result = [arr[0]]; | |
for (let i = 1; i < arr.length; i++) { | |
if (!memo[arr[i]]) { | |
result.push(arr[i]); | |
memo[arr[i]] = true; | |
} | |
} |
This file contains 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
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
This guide assumes that you recently run brew upgrade postgresql
and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.
First let's check something.
brew info postgresql
The top of what gets printed as a result is the most important: