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 'benchmark' | |
class Test | |
mcount = 1000 | |
mcount.times do |i| | |
class_eval "def method#{i}; end" | |
end |
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
tbl = table do | |
:foo | :bar | :baz | |
1 | 2 | 3 | |
1 | 3 | 5 | |
end # => [{:foo=>1, :bar=>2, :baz=>3}, {:foo=>1, :bar=>3, :baz=>5}] | |
tbl2 = table :horizontal do | |
:foo | 1 | 1 | |
:bar | 2 | 3 | |
:baz | 3 | 5 |
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 h = require('virtual-dom/h'); | |
var diff = require('virtual-dom/diff'); | |
var patch = require('virtual-dom/patch'); | |
var createElement = require('virtual-dom/create-element'); | |
var count = 0; | |
function countup() { | |
count += 1; | |
update(); |
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
'use strict'; | |
var h, mainLoop, render, viewLoop, viewModel; | |
mainLoop = require('main-loop'); | |
h = require('virtual-dom/h'); | |
viewModel = { | |
count: 0, | |
countUp: function() { |
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 h = require('virtual-dom/h'); | |
var diff = require('virtual-dom/diff'); | |
var patch = require('virtual-dom/patch'); | |
var createElement = require('virtual-dom/create-element'); | |
function update() { | |
var newTree = render(counter); | |
var patches = diff(tree, newTree); | |
patch(node, patches); | |
tree = newTree; |
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
Dir.glob("./**/*.haml").each do |haml| | |
jade = haml.gsub(/\.haml$/, ".jade") | |
`haml #{haml} --style ugly | html2jade --donotencode --noemptypipe --bodyless > #{jade}` | |
end |
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
import assert from "power-assert"; | |
import tapSpec from "tap-spec"; | |
const test = new Test(); | |
const {describe, it} = test; | |
describe("foo", () => { | |
describe(".bar", () => { | |
it("fetches bar", async () => { | |
const result = await foo.bar(); |
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 'pathname' | |
def count_lines(pathname) | |
count = 0 | |
pathname.each_child do |child| | |
if child.directory? | |
count = count + count_lines(child) |
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 'formula' | |
class Libcxx < Formula | |
homepage 'http://llvm.org/' | |
url 'http://llvm.org/releases/3.3/libcxx-3.3.src.tar.gz' | |
sha1 '7bea00bc1031bf3bf6c248e57c1f4e0874c18c04' | |
def install | |
cd './lib' do |
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
x = 5 | |
y = 10 | |
add = (x, y) => | |
x + y | |
end | |
z = add x, y | |
times = (i, fn) => | |
iteration = (j) => | |
switch j < i |
OlderNewer