Skip to content

Instantly share code, notes, and snippets.

View sweick23's full-sized avatar

Shane Weickum sweick23

View GitHub Profile
// get all
db.restaurants.find()
// limit and sort
db.restaurants.find().sort({name:1}).limit(10)
// get by _id
db.restaurants.findOne({}, {id: 1})._id
// get by value
https://glitch.com/edit/#!/agate-mitten
https://glitch.com/edit/#!/deep-girl
After letting some people I knew use my app, some bugs were found.
1.) when viewing on mobile my search button was missing.
I went and fixed the missing button issue.
2.)previoius searches were not being saved on the correct side of the screen.
adjusted my location of the saved previous searches.
3.)users wanted to click on a saved previous search and have the data get pulled back to view.
added a JS function to allow users to go back through their previous searches without having to retype them into the search bar.
@sweick23
sweick23 / gist:5d5f9a4ae42c31ffb4ab19481c5fe094
Created March 5, 2017 20:22
Front-end Capstone Project
Help users locate outdoor recreational spots like hiking, mountian biking and camping.
https://jsbin.com/rikiqe/edit?html,js,output
http://jsbin.com/sizibic/4/edit?html,css,js,output
http://jsbin.com/rekusey/2/edit?html,css,js,output
@sweick23
sweick23 / gist:c61f91a1e6095cdeeeb18c37522aa014
Created February 24, 2017 08:30
Challenge: analyze a most frequent word program.
function mostFrequentWord(text) {
//calls the getTokens function
var words = getTokens(text);
//used to create Objects from the//text
var wordFrequencies = {};
https://jsbin.com/weterey/edit?js,console
https://jsbin.com/zokapac/edit?js,console
https://jsbin.com/pivacoc/edit?js,console
https://jsbin.com/balujas/edit?js,console
https://jsbin.com/givilu/edit?js,console
https://jsbin.com/qifuje/edit?js,console
https://jsbin.com/turilev/edit?js,console
https://jsbin.com/kosegef/edit?js,console
https://jsbin.com/zatucu/edit?js,console
@sweick23
sweick23 / gist:6d567ba1abe379ecec5a9a82e95d98e8
Created February 23, 2017 07:45
Challenge: In your own words
What is scope? Your explanation should include the idea of global vs. local scope.
Why are global variables avoided?
Explain JavaScript's strict mode
What are side effects, and what is a pure function?
Explain variable hoisting in JavaScript
Scope is the way that JavaScript accesses variables in your code. The two different types of scope are global scope and local
scope. Global scope removes all boundaries from the variable declared. This allows all functions and other JavaScript files that
have access, to use the variable. Local scope is the scope within a function that only that function has access to.
A global variable should be avoided because if you write a function that is not pure, it could unintentionally manipulate
@sweick23
sweick23 / gist:58c772a0432829086b68b0c7e639d443
Created February 22, 2017 16:15
Arrays and Loops Drills
https://jsbin.com/simorek/edit?js,console
https://jsbin.com/juqujon/edit?js,console
https://jsbin.com/votipax/edit?js,console