Skip to content

Instantly share code, notes, and snippets.

@asw001
asw001 / gist:3e5facaaba2fda317edfd487c5c3af9a
Created July 1, 2017 01:48
Thinkful Aaron Williams BE Capstone Steps Decomposed
Project Preimplementation Outline
---------------------------------
Twitter Setup {Register, API credentials, set up project} - 30 minutes
Google Setup {Get API credentials, set up project} - 30 minutes
Research APIs, investigate API objects, map API behavior (Google, Twitter) - 2 hours
Determine Twitter bot behavior, MVP - 2 hours
* determine interaction with Mongo, e.g. will interactions be cached and/or persisted?
* does the bot operate in realtime?
* does it poll? how frequently
db.restaurants.find()
db.restaurants.find().limit(10).sort({name: 1})
db.restaurants.findOne({_id: documentId})
db.restaurants.find({borough: 'Queens'})
db.restaurants.find().count()
db.restaurants.remove({_id: ObjectId("AAAAAAAAAAAAAAAAA")})
db.restaurants.update({"_id" : ObjectId("59487d7493a61d80ae81d2ac")}, {params})
db.restaurants.updateMany({"bourough": 'Bronx'}, {"cuisine" : "American"})
@asw001
asw001 / gist:46c724e970537200e1778ef8544994f9
Last active June 12, 2017 03:06
unit1-request-response-drills
https://periodic-handsaw.glitch.me
https://tulip-catcher.glitch.me
https://burly-spy.glitch.me
@asw001
asw001 / gist:f23de8149297447b7bf92bffe2bbc659
Created June 7, 2017 04:10
User Feedback for FE Capstone, Aaron Williams
The front page was far too busy visually. Needed to remove all of the 12 images in the foreground and use only the background.
Replace black text with white; this showed up noticably better.
Shifted the quote display div 90px to the left to avoid clashing with corner of the wall in the image;
shifted the text entry prompt and text box as well
attempted and failed to match the text color in the background with text color of the form, opted to make the background transparent
Limited the quote to 600 characters -- works better with the natural border of the background
increased the display time by 1 second: from 5 to 6 seconds. was initially 3 seconds, not counting the fade in/fade out
Wall of Text MVP
-The user visits the site
-User is able to see the scroll of text
--the text is pulled from AWS S3
-Alternate: the text doesn't scroll, but is managed by button events
-User has the option of logging in using Google+ account for the purpose
of contributing their own text
The tentative name of the project is 'Writing On The Wall'. This project will use the Amazon Web Services
JavaScript SDK to implement a browser-only program that integrates Facebook authentication and uses AWS S3 service to store arbitrary data.
For the purposes of this project, S3 will be used to store text files of comments that users have 'written on the wall'. The textual data
will display as a slideshow.
Concerns are:
https://jsbin.com/poxihet/edit?html,css,js,output ==> cats
https://jsbin.com/fuwumej/edit?html,css,js,console,output ==> fizzbuzz
https://jsbin.com/digimuf/edit?html,css,js,output ==> lightbulb
@asw001
asw001 / gist:4f88be045277e935b7d72ff4e17d9460
Created May 3, 2017 03:06
scope, hoisting, side-effects
What is scope? Your explanation should include the idea of global vs. local scope.
Scope refers to the conditions under which a JavaScript program can access variables. There are two
types of scope in ECMAscript version 5: local and global.
Global variables are globally accessible, which means that they are accessible anywhere within a program. Contrasted
with global variables, local variables are accessible only within a function.
Variable precedence begins with local variables, located in functions, then moves outward to global variables contained
in the larger program; the implications of this are that if a variable were to be declared inside and outside of function,
@asw001
asw001 / gist:de7a17167c46109b216e4ffbac199f07
Created May 3, 2017 03:03
Thinkful word frequency script analysis
// the Boolean filter removes any items that considered false: NaN, false, 0, undefined
// this takes the 'unmassaged' data in the string -- this may be a paragraph, page, etc
// and 'tokenizes' the string, splitting on a single white space and common punctuation
// the function also remove variation in the string tokens, i.e. words, by converting them all to lowercase
// an array is returned sorted; at this point we can assume duplicate values in the array
https://jsbin.com/tudosot/edit?html,js,console,output ==> student report
https://jsbin.com/kuwubiw/edit?html,js,console,output ==> summer school
https://jsbin.com/sexofih/edit?html,js,console,output ==> find by id