Skip to content

Instantly share code, notes, and snippets.

Array.fromList = function(list) {
var array= new Array(list.length);
for (var i= 0, n= list.length; i<n; i++)
array[i]= list[i];
return array;
};
var lines = Array.fromList(document.querySelectorAll('.ecertificate-content')).map(function(node) {
var dds = node.querySelectorAll('dd');
return dds[0].textContent + "\t" + dds[1].textContent
@michaelmwu
michaelmwu / no_scope_pollution.rb
Created July 9, 2014 05:16
No scope pollution
gem 'activerecord', '~>3.2.1'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
# This connection will do for database-independent bug reports.
@michaelmwu
michaelmwu / scope_pollution_test.rb
Created July 9, 2014 05:14
Scope pollution inside scopes
gem 'activerecord', '~>4.1.4'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
# This connection will do for database-independent bug reports.
class Task[A] {
type self = Task
// Should be a staged block
val block: Exp[A]
// All dependencies must be Tasks that have been previously submitted, including
// Tasks submitted before this Task in the current generation and the previous
// generation
val dependencies : Array[self]