Skip to content

Instantly share code, notes, and snippets.

View detournemint's full-sized avatar
📻
On Air

detournemint

📻
On Air
View GitHub Profile
@detournemint
detournemint / gist:9357590
Last active August 29, 2015 13:57
Explanation of This in Javascript
This is set when function is called
This also depends on HOW it is called. Not how it is defined.
Examples =
constructor => this = new object ({})
var test = new Test();
method => this = receiver (test)
@detournemint
detournemint / Exercise 1
Created February 14, 2014 01:58
Solutions to Metaprogramming In Ruby
$results = []
$results << class A
def initialize
@a = 11
@@a = 22
a = 33
end
@a = 1
@@a = 2
@detournemint
detournemint / gist:8531239
Created January 20, 2014 23:08
LCD ruby quiz solution
def lcd(num, size)
horizontal = Proc.new do |n|
a = []
a << " "
a << ("-" * n)
a << " "
end
vertical = Proc.new do |n|
a = []