This file contains hidden or 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(){ console.log( eval('this') ); }.call({a:1})) | |
// Object {a: 1} | |
(function(){ console.log( (0,eval)('this') ); }.call({a:1})) | |
// Window {top: Window, window: Window, location: Location, external: Object, chrome: Object…} |
This file contains hidden or 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
// Let's assume we've got a situation where there's going to be a lot of | |
// binding, eg. doSomethingWith(myThing.getProp.bind(myThing)); and we want | |
// to simplify app code by reducing the number of times .bind(myThing) gets | |
// called. | |
var myThing = new Thing("Test"); | |
myThing.getProp() // "Test" | |
myThing.getProp.call(null) // "Test" | |
myThing.setProp("Another Test"); |
This file contains hidden or 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
it's okay |
This file contains hidden or 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
document.write = (function(write){ | |
var override = function() { | |
if(document.readyState !== "loading") { // document has finished loading - we want to intercept this call to document.write | |
if (window.ueLogError) { | |
try { | |
throw new Error("`document.write` called after page load on the gateway."); | |
} | |
catch(e) { | |
ueLogError(e, { logLevel : 'ERROR', attribution: 'gw-third-party-js' }); | |
} |
This file contains hidden or 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
--[[ | |
This is the configuration file for HoxHud. Please be careful editing values as you can cause the game to crash upon loading if a value is made invalid | |
We recommend colorpicker.com if you want to choose a color to use. The game also has some predefined colors and they are used here purely for brevity. | |
Only the following Colors are defined explicitly: | |
Color.red (FF0000), Color.green(00FF00), Color.blue (0000FF), Color.cyan (0000FF), Color.purple(FF00FF), Color.black (000000), Color.white (FFFFFF), Color.yellow (FFFF00) | |
]]-- | |
HoxHudTweakData = class() |
This file contains hidden or 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 j5 = require('johnny-five'); | |
var Leds = require('./leds').Leds; | |
var board = new j5.Board(); | |
var delay = 20; | |
var leds; | |
board.on('ready', function() { | |
leds = new Leds(4, 13); | |
var button = new j5.Button(2); |
This file contains hidden or 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
# (Include this function in your .bashrc) | |
# If the first argument is "init" or begins with "init:", run grunt-init. | |
# Otherwise run grunt. | |
function grunt() { | |
if [[ "$1" =~ ^init: ]]; then | |
grunt-init "${1##init:}" "${@:2}" | |
elif [ "$1" == "init" ]; then | |
grunt-init "${@:2}" | |
else |
This file contains hidden or 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() { | |
var $=['_'].concat(Array(arguments.length-1),'return _'); | |
var _=Function.apply(null,$); | |
$.forEach.call(arguments,function($,$$){_[$$]=$}); | |
return $.map.bind.call($.map,_,_); | |
}(5,6,7,8))() |
This file contains hidden or 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
SoundPlay *64 | |
; ============= | |
; Edit & Reload | |
; ============= | |
!^+F12:: | |
Edit | |
Reload | |
return |
This file contains hidden or 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 inception(f) { | |
try { | |
return 'recursion puts the "' + f.name + '" in "' + f(f) + '"'; | |
} catch (e) { | |
return ''; | |
} | |
} |