Skip to content

Instantly share code, notes, and snippets.

View Manny1806's full-sized avatar

Manny1806

  • PlusQA
  • Portland
View GitHub Profile
https://glitch.com/edit/#!/paper-veil
db.restaurants.find().pretty();
db.restaurants.find().sort({"name": 1}).limit(10).pretty()
var id = db.restaurants.findOne()._id;
db.restaurants.find({_id: id});
db.restaurants.find({"borough": "Queens"});
db.restaurants.count();
db.restaurants.find({"address.zipcode": "11206"}).pretty();
db.restaurants.deleteOne({_id: id});
db.restaurants.updateOne({_id: id},{$set: {"name": "Bizz Bar Bang"}});
db.restaurants.updateMany({"address.zipcode": "10035"}, {$set: {"address.zipcode": "10036"}});
2018-05-28 19:21:34.896 PDT [19160] LOG: listening on IPv6 address "::1", port 5432
2018-05-28 19:21:34.896 PDT [19160] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-05-28 19:21:34.929 PDT [19160] FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": Permission denied
2018-05-28 19:21:34.929 PDT [19160] LOG: database system is shut down
2018-05-29 09:36:20.036 PDT [24089] LOG: listening on IPv6 address "::1", port 5432
2018-05-29 09:36:20.036 PDT [24089] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-05-29 09:36:20.080 PDT [24089] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-05-29 09:36:20.226 PDT [24090] LOG: database system was shut down at 2018-05-29 09:36:10 PDT
2018-05-29 09:36:20.281 PDT [24089] LOG: database system is ready to accept connections
2018-05-29 09:42:05.945 PDT [24206] ERROR: syntax error at or near "SELECT" at character 27
@Manny1806
Manny1806 / gist:dcd4959eee4387debe54ed380d8e1fe1
Created May 22, 2018 20:50
Request and response drills
https://fixed-pond.glitch.me//echo/cars?raceCar=vroom&smallTruck=puttputt
https://ten-bun.glitch.me
@Manny1806
Manny1806 / gist:3b9512972fee43ed51f422520ce0378b
Created April 14, 2018 16:54
tech eval code for Alex Widner
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
function kmToMiles (numKm){
return Math.floor(numKm/1.6);
}
https://repl.it/@manny1806/Make-student-reports-drill
https://repl.it/@manny1806/Enroll-in-summer-school-drill
https://repl.it/@manny1806/find-by-id-drill
https://repl.it/@manny1806/validate-object-keys-drill
https://repl.it/@manny1806/Object-creator-drill
https://repl.it/@manny1806/Object-updater-drill
https://repl.it/@manny1806/Self-reference-drill
https://repl.it/@manny1806/Deleting-keys-drill
1. Scope refers to the accessibility of a variable. If a variable is created outside of a function its scope is considered
to be global which means it can be accessed by any function in the javascript file. Global variables can even be accessed
by other linked Javascript files as long as the file with the global variable is loaded first. Variables that are created
in a function are considered to have local scope which means they can only be accessed within the function they were created
in. When a local scope variable is created that has the same as a global scope variable, the local variable will take
precedence over the global variable and not affect the global variable.
2. Global variables are avoided in Javascript because they can lead to unintended results. When more than one function uses
or alters a global variable it risks the outcome of the functions being not what is expected. One function might assume
a global variable has a certain value when in fact another function has
https://repl.it/@manny1806/fizzbuzz-drill-js
https://repl.it/@manny1806/average-drill
https://repl.it/@manny1806/min-and-max-without-sort-drill
https://repl.it/@manny1806/Array-copying-I-drill
https://repl.it/@manny1806/Array-copying-II-drill
https://repl.it/@manny1806/Squares-with-map-drill
https://repl.it/@manny1806/Sort-drill
https://repl.it/@manny1806/Filter-drill