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 add() { | |
var args = [].slice.call(arguments); | |
var sum = args.reduce(function(a, b){ return a + b; }, 0); | |
return numify(sum); | |
function numify(num){ | |
var ret = function(a){ | |
return a === undefined ? numify(num) : numify(a + 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
var compiler = new traceur.Compiler; | |
compiler.script(content, {experimental: true}) | |
.then(function(result){ | |
var source = result.js; | |
eval(source); | |
}); |
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
on run {} | |
activate application "Microsoft Outlook" | |
tell application "Microsoft Outlook" | |
set selected folder to folder "Archive" | |
end tell | |
tell application "System Events" | |
keystroke "f" using {option down, command down} | |
end tell | |
end run |
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
class SumOfFactors | |
def initialize(until_num, *divisible_by) | |
@until_num = until_num | |
@divisible_by = divisible_by | |
end | |
def get_sum | |
get_range.select(&self.method(:is_disivible_by)) | |
.inject(&self.method(:sum_arr)) |
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 MyApp = { | |
addPlaceholders: function(props) { | |
// default configuration | |
var config = { | |
'class': 'placeholder' // apply CSS classes to an input displaying a placeholder | |
}; | |
// if any properties were supplied, apply them to the config object |
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
if(typeof _scriptsRecorded == "undefined"){ | |
var scriptBodies = {} | |
var scripts = document.querySelectorAll("script"); | |
for(var i = 0, len = scripts.length;i<len;i++){ | |
var script = scripts[i]; | |
(function(src){ | |
$.get(src, function(data){ | |
scriptBodies[src] = data; | |
}) | |
})(script.src) |
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
return; |
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
class Mixin(value: Int){ | |
def myCrazyNameOperator(f: Int => Int) : Int = f(value) | |
} | |
implicit def toWTF(value: Int) = new Mixin(value); | |
def double(int: Int) = {2 * int} | |
def triple(int:Int) = {3 * int} |
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 __temp_trigger = $.fn.trigger; | |
$.fn.trigger = function(){console.log(arguments, " triggered on element ", this); return __temp_trigger.apply(this,arguments);} |
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 options_to_add = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"20+"]; | |
var event = document.createEvent("MouseEvents"); | |
event.initMouseEvent("click", true, true, window, | |
0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
for(var i=0,len=options_to_add.length;i<len;i++){ | |
$$(".option_add")[0].dispatchEvent(event) | |
var empty_element = $$(".option_editor_row").filter(function(el){return el.firstChild.value == ""})[0]; |
OlderNewer