- Set
NODE_ENV
toproduction
on Heroku withheroku config:set NODE_ENV=production
- This sets the
NODE_ENV
environment variable on Heroku
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
// Put this before your routes | |
// ---------------------------------------- | |
// Mongoose | |
// ---------------------------------------- | |
const mongoose = require('mongoose'); | |
app.use((req, res, next) => { | |
if (mongoose.connection.readyState) { | |
next(); | |
} else { |
This file has been truncated, but you can view the full file.
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
{ | |
"a": "The first letter of the English and of many other alphabets.The capital A of the alphabets of Middle and Western Europe, as alsothe small letter (a), besides the forms in Italic, black letter,etc., are all descended from the old Latin A, which was borrowed fromthe Greek Alpha, of the same form; and this was made from the firstletter (Aleph, and itself from the Egyptian origin. The Aleph was aconsonant letter, with a guttural breath sound that was not anelement of Greek articulation; and the Greeks took it to representtheir vowel Alpha with the ä sound, the Phoenician alphabet having novowel symbols. This letter, in English, is used for several differentvowel sounds. See Guide to pronunciation, §§ 43-74. The regular longa, as in fate, etc., is a comparatively modern sound, and has takenthe place of what, till about the early part of the 17th century, wasa sound of the quality of ä (as in far).", | |
"ab": "The fifth month of the Jewish year according to theecclesiastical reckoning, the eleventh by the |
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
function * chunkGen(collection, size=2, i=0) { | |
for (; i < collection.length; i += size) { | |
yield collection.slice(i, i + size); | |
} | |
} | |
function chunk(collection, size=1) { | |
const chunked = []; | |
const gen = chunkGen(collection, size); | |
let c = gen.next(); |
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
{ | |
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
// Placeholders with the same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "scope": "javascript,typescript", |
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
echo '' | |
echo "Hello $(whoami)!" | |
echo '' | |
# ------------------------------------ | |
# Directory Shortcuts | |
# ------------------------------------ | |
alias back='cd $OLDPWD' | |
alias up='cd ..' |
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
/** | |
* Creates and returns a 2D array range from the source array | |
* @param {Array} array - The source array | |
* @param {number} y - The y position from which to start the range | |
* @param {number} x - The x position from which to start the range | |
* @param {number} h - The height of the range | |
* @param {number} w - The width of the range | |
* @returns {Array} The selected range | |
*/ |
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
function eq(a, b) { | |
return new Promise(function(resolve, reject) { | |
a === b ? | |
resolve(`${ a } === ${ b }`) : | |
reject(`${ a } !== ${ b }`); | |
}); | |
} | |
function eqs(a, b) { | |
return new Promise(function(resolve, reject) { |
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
class Node { | |
constructor(value, next) { | |
this.value = value; | |
this.next = next; | |
} | |
} | |
class LinkedList { | |
constructor() { | |
this.head = null; |
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
var NUM_COUNT = 1000; | |
var _nums; | |
function _everyFiveWaitASecond() { | |
var chunk = function(i, results) { | |
results = results || []; | |
console.log('chunk(', i, ')'); | |
if (!_nums.length) { |