Skip to content

Instantly share code, notes, and snippets.

View Arkangel17's full-sized avatar
:octocat:

Kelly Justin Wilson Arkangel17

:octocat:
View GitHub Profile
// Get all
db.restaurants.find();
// Limit and sort
db.restaurants.find().sort({name: 1}).limit(10);
// Get by _id
@Arkangel17
Arkangel17 / function flattenArr
Created December 1, 2018 00:45
flatten nested arrays
let test = [1, 2, [3], [4, 3], 5]
function flattenArr(arr) {
let res = [];
arr.map((item =>{
let type = typeof(item);
if(type !== 'number'){
for(i = 0; i < item.length; i++){
res.push(item[i]);
}
@Arkangel17
Arkangel17 / node shopping list v3 : add-test DELETE function
Created November 12, 2018 17:02
thinkful project: node-shopping-list-v3
https://github.com/Arkangel17/node-shopping-list-v3_DELETE.git
@Arkangel17
Arkangel17 / node-shopping-list-v2 POST request
Created November 10, 2018 23:01
completed POST request thinkful project
GitHub Repo Link:
https://github.com/Arkangel17/node-shopping-list-v2.git
@Arkangel17
Arkangel17 / node shopping list : add-test Recipe
Created November 10, 2018 22:05
Server: unit1Lesson4: create GET endpoints
GitHub repo:
https://github.com/Arkangel17/node-shopping-list-v1/commits/master
URL / Postman Testing:
http://localhost:8080/recipes
@Arkangel17
Arkangel17 / herokuApp_coolFaces
Created November 10, 2018 20:48
Heroku App: Cool Faces
https://powerful-cliffs-65021.herokuapp.com/cool
@Arkangel17
Arkangel17 / gateKeeper
Created November 6, 2018 23:11
Create custom middleware to provide login authentication per Server-side Unit 1 | Lesson 2
Glitch Code:
https://glitch.com/edit/#!/amused-shrine?path=server.js:7:0
use postman with this address:
https://amused-shrine.glitch.me/api/users/me
and the following header:
[{"key":"x-username-and-password","value":"user=joeschmoe@business.com&pass=password","description":""}]
@Arkangel17
Arkangel17 / echo drill
Last active March 25, 2019 23:20
serverUnit1_reqResDrilz 181104
https://glitch.com/edit/#!/standing-reminder?path=server.js:4:0
request: { must copy and paste this to url after clicking 'show live' }
/echo/pets?cat=meow&dog=woof
study resources:
https://expressjs.com/en/guide/routing.html#route-parameters