Skip to content

Instantly share code, notes, and snippets.

View piotrmurach's full-sized avatar
:shipit:
Working on tty-markdown

Piotr Murach piotrmurach

:shipit:
Working on tty-markdown
View GitHub Profile
@piotrmurach
piotrmurach / tty_table_bechmarks
Created February 3, 2013 14:17
TTY gem table border rendering benchmarks.
Calculating -------------------------------------
Ruby #to_s 314 i/100ms
TTY #to_s 18 i/100ms
TTY ASCII #to_s 10 i/100ms
TTY Unicode #to_s 10 i/100ms
TTY Color #to_s 6 i/100ms
-------------------------------------------------
Ruby #to_s 3184.8 (±2.6%) i/s - 16014 in 5.031549s
TTY #to_s 180.9 (±0.6%) i/s - 918 in 5.074281s
TTY ASCII #to_s 103.3 (±1.9%) i/s - 520 in 5.039067s
@piotrmurach
piotrmurach / coffeescript global namespace
Created November 3, 2011 22:59
Attaching variables to global namespace
This will declare some 'foo' function in the global namespace, whatever it happens to be
root = exports ? this
root.foo = -> 'Hello World'
Example of creating namespaced variables
class Storage
constructor: (root) ->
if typeof(exports) !== 'undefined'
Storage = exports