Skip to content

Instantly share code, notes, and snippets.

View goblincore's full-sized avatar
🐌
turtle

Donny goblincore

🐌
turtle
View GitHub Profile
@goblincore
goblincore / gist:13d931e85028e5ffa49470fda08dd1d7
Last active April 6, 2018 13:11
Javascript String Drills
https://repl.it/@keithnull/Wiseperson-generator-drill-1
function wisePerson(wiseType, whatToSay) {
const wiseDom =`A wise ${wiseType} once said: "${whatToSay}".`;
return wiseDom
}
https://repl.it/@keithnull/shouter-drill
@goblincore
goblincore / JS number drills
Created April 6, 2018 13:25
JS number drills thinkful
https://repl.it/@keithnull/area-of-a-rectangle-drill
function computeArea(width, height) {
// your code here
return width*height;
}
https://repl.it/@keithnull/temperature-conversion-drill
@goblincore
goblincore / JS Logic Drills
Created April 6, 2018 13:48
Thinkful Logic Drills JS
https://repl.it/@keithnull/Traffic-lights-drill
function doTrafficLights() {
const activeLight = getActiveLight();
// your code will replace this call
// to `console.log()`
console.log(activeLight);
if(activeLight === 'red'){
@goblincore
goblincore / Array basics JS
Created April 6, 2018 14:07
JS thinkful Array basics
https://repl.it/@keithnull/Creating-arrays-drill
function makeList(item1, item2, item3) {
// your code here
const myArray = [item1,item2,item3];
return myArray
https://repl.it/@keithnull/Array-copying-I-drill
https://repl.it/@keithnull/Array-copying-II-drill
https://repl.it/@keithnull/Squares-with-map-drill
https://repl.it/@keithnull/Sort-drill
https://repl.it/@keithnull/Filter-drill
https://repl.it/@keithnull/Find-drill
@goblincore
goblincore / LoopsArraysJS
Created April 11, 2018 17:47
Loops and Arrays JS Thinkful
https://repl.it/@keithnull/min-and-max-without-sort-drill
https://repl.it/@keithnull/average-drill
https://repl.it/@keithnull/fizzbuzz-drill-js
What is scope?
In the context of variables and their values, scope can be thought of as the range in which a particular variable and its accompanying assigned value are effective.
In otherwords, scope is the space within which a variable operates.
This space can be defined as global or local: a globally scoped variable will be accessible to all functions, everywhere in a program while a locally scoped variable will only be accesible within the function it resides in.
In Javascript, when a variable is called in a function the program first looks in the local function to see if the variable is defined; if not it looks in the global scope.
If there are two variables with the same name - one local, one global - then the local variable will take precedence within the function it resides in,
but outside of that function the global variable will retain it's assigned value.
@goblincore
goblincore / Object Drills 1 JS
Created April 12, 2018 22:40
Object Drill 1
https://repl.it/@keithnull/Object-creator-drill
https://repl.it/@keithnull/Object-updater-drill
https://repl.it/@keithnull/Self-reference-drill
https://repl.it/@keithnull/Deleting-keys-drill
@goblincore
goblincore / techval
Created April 18, 2018 14:21
Thinkful tech eval april 18th Kevin
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter:
@goblincore
goblincore / gist:25391839fa72fcf09a69633fa7e9ac54
Last active July 2, 2018 18:45
PostgreSQL shell basic drills
1. Get all restaurants
Write a query that returns all of the restaurants, with all of the fields.
SELECT * FROM restaurants;
2. Get Italian restaurants
Write a query that returns all of the Italian restaurants, with all of the fields
SELECT * FROM restaurants
WHERE cuisine = 'Italian;