Skip to content

Instantly share code, notes, and snippets.

View goldtreefrog's full-sized avatar

Margaret Blauvelt goldtreefrog

View GitHub Profile
@goldtreefrog
goldtreefrog / gist:2f8218bac8ea9067afa29246cfd3767f
Created April 2, 2018 16:14
Creature Logger (Changed from Bird Logger)
User stories: See https://github.com/goldtreefrog/bird-logger
Screens:
- Add/Update Sighting (same screen with minor variations)
- List Sightings
- Select species from list of similar common names
User flows: See https://github.com/goldtreefrog/bird-logger
@goldtreefrog
goldtreefrog / bird-logger-user-stories
Created February 27, 2018 01:06
User Stories for Bird Logger
As an avid bird watcher, I want to keep track of the birds I have seen.
As a bird enthusiast, I want to look up general information about a bird.
As a bird watcher, I want to confirm that I have the right bird by comparing features with what I observed.
As a researcher, I want to generate statistics about bird sightings.
Get all: Retrieve all restaurants.
db.restaurants.find()
Limit and sort: Make the first 10 restaurants appear when db.restaurants is alphabetically sorted by the name property.
db.restaurants.find({},{name: 1}).sort({name: 1}).limit(10);
Get by _id - Retrieve a single restaurant by _id. (First get the _id for one of the restaurants.)
const myId = db.restaurants.findOne()._id;
db.restaurants.findOne({_id: myId});
@goldtreefrog
goldtreefrog / feature-changes
Created January 2, 2018 18:47
Write to Speak: Future Feature Changes Numbered by Priority (also Recently Done)
Date: 1/2/2018
------------------------------------------------------------------
index.html
7. Spoken summary on introductory page. (Easy.)
8. Smaller graphic on intro page so can see more of whole page at once. (Easy. Crop the bottom of the picture?)
9. Short demo on write or intro page. (Medium time. This would be the enhanced version of an auditory-only summary and may replace it or be a movie user can click on.)
@goldtreefrog
goldtreefrog / Write to Speak
Created December 5, 2017 19:20
Write to Speak Summary Statement
A simple editor aimed at beginning spellers with on-demand text-to-speech for the mechanics of communication - spelling, writing and speaking.
@goldtreefrog
goldtreefrog / u3l1p3-event-listener-drills
Created October 26, 2017 02:34
Event Listener Drills
https://repl.it/NNb5/0 - Cat Carousel
https://repl.it/NPTn/1 - FizzBizz
@goldtreefrog
goldtreefrog / u2l6p6-analyze-frequent-word-program
Created October 23, 2017 19:02
Analysis of Frequent Word Program
The mostFrequentWords() function passes a string to the getTokens() function, which
splits it into an array of words, returning that to mostFrequentWords(), which saves
it into the "words" array. mostFrequentWords() then tabulates each word in the array,
storing the results in an object array called wordFrequencies, within which each
unique word is a key with a value corresponding to the number of times the word was
encountered in the
"words" array.
The function then loops through the wordFrequences array to find the word
with the highest number of occurrences, comparing each count to the highest
@goldtreefrog
goldtreefrog / u2l6p5-object-drills-2
Last active October 23, 2017 02:15
Object Drills 2
https://repl.it/NCFD/1 - Create a function that takes an object and outputs an array ready for report (u2l6p5-make-student-reports.js)
https://repl.it/NCtc - Input an array to change students' status value, returning in another array. (u2l6p5-enroll-in-summer-school.js)
https://repl.it/NDCK - Given an array of objects and an ID number, find the one whose ID number matches. (u2l6p5-find-by-id.js)
https://repl.it/NDGt - Validate keys in object against expected keys. (u2l6p5-validate-object-keys.js)
@goldtreefrog
goldtreefrog / u2l6p2-object-drills-1
Last active October 22, 2017 05:01
Object Drills 1
https://repl.it/NBRi - Object Creator; create an object literal (u2l6p2-object-creator.js)
https://repl.it/NBSM - Object Updater; add keys to an existing object (u2l6p2-object-updater.js)
https://repl.it/NBST/1 - Self-Reference; reference variables within the same function using "this". (u2l6p2-self-reference.js)
https://repl.it/NBSF/2 - Deleting Keys (u2l6p2-deleting-keys.js)
@goldtreefrog
goldtreefrog / u2l5p3-scope-and-globals
Created October 20, 2017 16:58
Scope and the Problem with Globals Q&A
What is scope? Your explanation should include the idea of global vs. local scope.
A: Scope refers to where a variable gets and retains its value and definition. A variable defined within a function only retains its definition and value within that function (and within subfunctions of that function). A variable defined globally is accessible and changeable everywhere, but if a variable with the same name is defined locally within a function, that local variable takes precedence while within that function - and disappears outside the function, while the global variable remains.
Why are global variables avoided?
A: Unexpected results are more likely to happen because a variable such a variable may be used by more than one function, and changing its value from within one function will change it for other functions as well. If that was not the intention, bugs will happen.
Explain JavaScript's strict mode
A: JavaScript's "use strict" statement causes JavaScript to issue an error any time a variable is not explic