Skip to content

Instantly share code, notes, and snippets.

View johnkorzhuk's full-sized avatar

John Korzhuk johnkorzhuk

  • Sarasota, FL
View GitHub Profile
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
del = require('del'),
lazy = require('lazypipe'),
browserSync = require('browser-sync').create(),
runSequence = require('run-sequence'),
cleanCss = require('gulp-clean-css'),
merge = require('merge-stream'),
reload = browserSync.reload,
$ = gulpLoadPlugins();
@johnkorzhuk
johnkorzhuk / init.lua
Created July 23, 2016 13:57
hammerspoon init file.
--------------------------------------------------------------------------------
-- rtoshiro - https://github.com/rtoshiro
-- You should see: http://www.hammerspoon.org/docs/index.html
--------------------------------------------------------------------------------
-------------------
-- John's Config --
-------------------
--------------------------------------------------------------------------------
https://jsbin.com/ruyahuv/3/edit?js,console
https://jsbin.com/faveqip/3/edit?js,console
https://jsbin.com/muzapex/3/edit?js,console
@johnkorzhuk
johnkorzhuk / gist:28356f2577aedf845fce48f3884f0513
Created February 27, 2017 19:43
Unit 2: Lesson 2: Number drills
https://jsbin.com/nilovix/2/edit?js,console
https://jsbin.com/ciwuqep/3/edit?js,console
https://jsbin.com/fihedoh/2/edit?js,console
@johnkorzhuk
johnkorzhuk / gist:9640b291018c218a05639c572a7b1f8d
Created February 27, 2017 20:35
Unit 2: Lesson 3: Logic Drills
https://jsbin.com/cofuwi/3/edit?js,console,output
https://jsbin.com/zomogu/3/edit?js,console,output
@johnkorzhuk
johnkorzhuk / gist:5d435a26f3ba5ace84491ff8453d4b20
Last active February 27, 2017 21:24
Unit 2: Lesson 4: Array drills
https://jsbin.com/honiri/2/edit?js,console
https://jsbin.com/doseze/4/edit?js,console
https://jsbin.com/majigup/2/edit?js,console
https://jsbin.com/lecafo/2/edit?js,console
https://jsbin.com/voyaxe/5/edit?js,console
https://jsbin.com/tutapah/6/edit?js,console
https://jsbin.com/pixihub/2/edit?js,console
https://jsbin.com/lesoyo/2/edit?js,console
https://jsbin.com/jelomek/2/edit?js,console
https://jsbin.com/jugifeq/2/edit?js,console
@johnkorzhuk
johnkorzhuk / gist:75ca8dcb9475b776c1418e7a218aaaa1
Created February 27, 2017 22:22
Unit 2: Lesson 4: array and loops drill
https://jsbin.com/xoyiyah/2/edit?js,console
https://jsbin.com/zidoqef/2/edit?js,console
https://jsbin.com/debafi/6/edit?js,console
What is scope?
John Resig coauthored a book "Secrets of the JavaScript Ninja, second edition" that really solidified my understanding
of scope in javascript. Global and local/functional scope is a consequence of lexical environments and execution context (global and functional). If in a function an undeclared variable identifier is referenced, its outer lexical environment is checked for that variable, this is done until the global execution context is reached, if that variable is found, its reference is assigned to the inner identifier, if not, a global variable identifier is created.
Why are global variables avoided?
Global variable can cause identifier conflicts in a lot of unexpected ways.
Explain JavaScript's strict mode.
This forces the interpreter to be "more strict" with certain default javascript behaviors. i.e. referencing an undeclared variable from within a function will not create a global variable.
@johnkorzhuk
johnkorzhuk / gist:97649bdb33e014430d6554452a4fdfd8
Last active February 28, 2017 13:46
Unit 2: Lesson 6: object drills 1
https://jsbin.com/lamuqir/2/edit?js,console
https://jsbin.com/nupadar/2/edit?js,console
https://jsbin.com/qecixep/2/edit?js,console
https://jsbin.com/vopuga/2/edit?js,console
@johnkorzhuk
johnkorzhuk / gist:683951ad218bfb49f93ab2282302255e
Created February 28, 2017 15:10
Unit 2: Lesson: 5: Object drills 2
https://jsbin.com/faqeme/2/edit?js,console
https://jsbin.com/yecilug/4/edit?js,console
https://jsbin.com/gikacu/2/edit?js,console
https://jsbin.com/madopo/14/edit?js,console
https://jsbin.com/qeqonom/5/edit?js,console