Skip to content

Instantly share code, notes, and snippets.

View scwebd's full-sized avatar

Sarah Cullen scwebd

  • Denver, CO
View GitHub Profile
Stacks:
>> Achieving an undo operation
>> Browser/app back button
>> Error stacks in JS
>> Calling a function inside a function (it pushes the current data -- local variables, etc -- onto the stack to be retrieved once the control is returned)
db.animals.insert({"name":"Panda", "numLegs":4, "class":"mammal", "weight": 254, "whatIWouldReallyCallIt":"Captain Fuzzy Face"});
db.animals.insert({"name":"Dog", "numLegs":4, "class":"mammal", "weight": 60, "whatIWouldReallyCallIt":"Captain Fuzzy Face II"});
db.animals.insert({"name":"Ostrich", "numLegs":2, "class":"aves", "weight": 230, "whatIWouldReallyCallIt":"Steve"});
db.animals.insert({"name":"Kangaroo", "numLegs":2, "class":"marsupial", "weight": 200, "whatIWouldReallyCallIt":"Bouncer"});
db.animals.insert({"name":"Chameleon", "numLegs":4, "class":"reptile", "weight": 5, "whatIWouldReallyCallIt":"Scales"});
var myArray = [1, 2, 3, 4, 5];
for(var i=0; i < myArray.length; i++){
console.log(myArray[i]);
}
brew services start mongodb-community
brew services stop mongodb-community
@scwebd
scwebd / .git-commit-template.txt
Created February 11, 2020 23:24 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
# removes all node_modules folders recursively
find . -name "node_modules" -exec rm -rf '{}' +
# I found this command on Coderwall at
# https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
const keys = {
"s3bucket": "du-bootcamp-s3-example",
"s3key": "AKIARWHMBPRTKOLQSFCO",
"s3secret": "RSUF6BEsYud1ZvY7mgv/fVc0EMi0Gzpygx4RxW4h",
};
@channel If you have trouble deploying to Heroku, here are a few things to check on:
Verify that your main server file (whatever its name) and package.json are at the root level of the repository; if this means you need to shuffle things around, verify that the app works locally before deploying.
Check your package.json and verify that there is a ‘scripts’ sub-object with a key/val pair like this: "start": "node server.js" (note that the file name will differ based on the name of the file that contains your Express server.)
Verify that your PORT variable is dynamic. For example: const PORT = process.env.PORT || 3000 .
Verify that you have a ‘get’ route at /.
Verify that your package.json dependencies section includes all required npm packages.
If all else fails and your app throws an error upon deployment, run heroku logs --tail and Google/research the error code(s) you find there.