Skip to content

Instantly share code, notes, and snippets.

View marthakelly's full-sized avatar

Martha Kelly Schumann marthakelly

View GitHub Profile
/*
* Variables declared with var are hoisted and initialized to undefined.
* Variables declared with let, const, are hoisted but remain uninitialized.
*/
function letsFigureOutHoisting() {
// VARIABLE NAMES ARE HOISTED PHYSICALLY HERE, AT THE TOP OF THE FUNCTION
// we're referencing these variables BEFORE they are assigned values!
console.log(cat); // will throw a ReferenceError
console.log(dog); // will evaluate to undefined
@marthakelly
marthakelly / boto-fab
Created August 9, 2012 15:46
Creating EC2 instance with Boto and Fabric
from fabric.api import *
from fabric.colors import green as _green, yellow as _yellow
import boto
import boto.ec2
from config import *
import time
def create_server():
"""
Creates EC2 Instance
@marthakelly
marthakelly / data-structure
Created July 3, 2012 01:56
interesting use case for recursion
[
{
"indentLevel": 0,
"selector": "body",
"declarations": [
" margin: auto",
" width: 1000px"
],
"children": []
},
@marthakelly
marthakelly / data
Created June 30, 2012 20:07
Recursing through a nested block data structure (code simplified for discussion)
[
{
"indentLevel": 0,
"selector": "body",
"declarations": [
" margin: auto",
" width: 1000px"
],
"children": []
},