This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var asymHumanoidBodyParts = [["head", 3], | |
["left-eye", 1], | |
["left-ear", 1], | |
["mouth", 1], | |
["nose", 1], | |
["neck", 2], | |
["left-shoulder", 3], | |
["left-upper-arm", 3], | |
["chest", 10], | |
["back", 10], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(global) { // global is == to window | |
"use strict"; // Tells JS engine to warn you about silly things you've done | |
var myVariable = 10; | |
function internalFunction(val) { | |
return myVariable * val; | |
} | |
global.externalFunction = function(num){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>IIFE App</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<input type="button" id="idButton" value="Click Me!"> | |
<div id="idOutput"></div> | |
<script type="text/javascript" src="LoadIIFE.js"></script> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>IIFE App</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<input type="button" id="idButton" value="Click Me!"> | |
<div id="idOutput"></div> | |
<script type="text/javascript" src="LoadIIFE.js"></script> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parent = {a:2, b:33}; | |
var ChildMaker = function(){}; | |
ChildMaker.prototype = parent; | |
var child = new ChildMaker(); | |
parent.c = 2; | |
child.c; // 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var require = function(require){ | |
var NM = function(){ | |
var src = process.binding('natives'); | |
src = Object.keys(src).reduce(function(ret, key){ | |
ret[key] = src[key]; | |
return ret; | |
}, {}); | |
var NM = function NativeModule(id) { | |
this.filename = id + '.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var locations = JSON.parse(body); | |
locations = _.first(locations, 10); | |
_.map(locations, function(loc) { | |
geocoder.geocode(loc.loc_address + ',' + loc.loc_city + ',' + loc.loc_state + ',' + loc.loc_zip, function(err, data) { | |
if (err) | |
errorHandler(err); | |
// console.log(data.results[0].geometry.location); | |
loc.location = data.results[0].geometry.location; | |
// done(); | |
return loc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deepCopy = (function () { | |
var funcBlacklist = ['caller', 'arguments', 'prototype' ], | |
primitiveCloner = makeCloner(clonePrimitive), | |
cloneFunctions = { | |
'[object Null]': primitiveCloner, | |
'[object Undefined]': primitiveCloner, | |
'[object Number]': primitiveCloner, | |
'[object String]': primitiveCloner, | |
'[object Boolean]': primitiveCloner, | |
'[object RegExp]': makeCloner(cloneRegExp), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// current scope is global.. | |
function Test(n) { | |
this.test = n; | |
var bob = function (n) { | |
this.test = n; | |
}; | |
this.fn = function (n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> jm???in | |
Here's what I found: | |
[ 'jamming' ] | |
> |
OlderNewer