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
require 'nokogiri' | |
file = ARGV[0] | |
if !File.exist?(file) | |
puts "File #{file} does not exist." | |
exit | |
end | |
html = File.read(file) |
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
/** | |
* Using yield to create a generator -- only possible in ES6/Harmony. | |
*/ | |
function fibonacci(limit) { | |
var fn1 = 1; | |
var fn2 = 1; | |
while (1) { | |
var current = fn2; | |
fn2 = fn1; | |
fn1 = fn1 + current; |
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
window.addEventListener('load', function() { | |
// This 'createWrapper' method is super weird and awkward and I'm not proud of | |
// it at all. But right now it's the only option for defining custom sequence | |
// types that wrap arbitrary sources. In a future version I will come up with | |
// something much better, swear to God. | |
var jqueryWrapper = Lazy.createWrapper(function(selector, eventName) { | |
var source = this; | |
$(selector).on(eventName, function(e) { | |
source.emit(e); | |
}); |
OlderNewer