Skip to content

Instantly share code, notes, and snippets.

@Jeff-Oriente
Jeff-Oriente / noteful-app.sql
Created October 15, 2018 21:01 — forked from cklanac/noteful-app.sql
SQL Scripts to create and populate tables for Noteful App
DROP TABLE IF EXISTS notes;
CREATE TABLE notes (
id serial PRIMARY KEY,
title text NOT NULL,
content text,
created timestamp DEFAULT now()
);
https://repl.it/@Bandada/Cat-carousel-jQuery
@Jeff-Oriente
Jeff-Oriente / gist:54f9123afadd83dc71c4a2665765a8cc
Created February 17, 2018 20:07
Challenge: analyze a most frequent word problem
function getTokens(rawString) { // A function is being created. It isn't anonymous. It has the name getTokens. The argument is rawString.
// NB: `.filter(Boolean)` removes any falsy items from an array // A comment
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort(); // Argument is being returned lower case. String is being split into substrings. Boolean is filtering. Sort is sorting.
}
function mostFrequentWord(text) { // New function being created with text as an argument
let words = getTokens(text); // Variable called words being created. Getting set equal to first function.
let wordFrequencies = {}; // New object being created. Variable it is set to is wordFrequencies
for (let i = 0; i <= words.length; i++) { // For loop being created. It runs as long as i is less than words.length. Increments by 1 each time
if (words[i] in
https://repl.it/@Bandada/Make-student-reports-drill-1
https://repl.it/@Bandada/Object-creator-drill
@Jeff-Oriente
Jeff-Oriente / gist:2fdeab45a93b3ca128b91cadeb07a9b3
Created February 14, 2018 06:53
Scope and the problem with globals Challenge: In your own words
QUESTION: What is scope? Your explanation should include the idea of global vs. local scope.
ANSWER:
Scope is essentially a set of rules that define which parts of your code can access a particular variable. Scope is what
allows us to reuse variables at different points in our code without it breaking. With regards to global scope, rules set
there can affect the entirety of the code. With regards to local scope, rules set there only impact the code on a local
level, such as within a function itself.
https://repl.it/@Bandada/min-and-max-without-sort-drill-1
https://repl.it/@Bandada/Array-copying-I-drill
https://repl.it/@Bandada/Creating-arrays-drill
https://repl.it/@Bandada/Traffic-lights-drill