Skip to content

Instantly share code, notes, and snippets.

View drewbaumann's full-sized avatar
:octocat:
Coding up a storm

Drew Baumann drewbaumann

:octocat:
Coding up a storm
View GitHub Profile
require 'benchmark'
count = 1000000
Benchmark.benchmark do |bm|
bm.report("concat") { count.times { 11.to_s + '/' + 12.to_s } }
bm.report("interp") { count.times { "#{11}/#{12}" } }
bm.report("join") { count.times { ["11", "12"].join("") } }
end
@drewbaumann
drewbaumann / exportjson.js
Created February 29, 2012 23:38 — forked from pamelafox/exportjson.js
Google Spreadsheet JSON Export
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';