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
def counter(start=0, increment=1) | |
lambda do | |
original = start | |
start += increment | |
original | |
end | |
end | |
result = counter(2, 3) |
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
parameters.collect do |key, value| | |
"#{key}=#{value}" | |
end | |
# => ["ns0=1", "title=Special:Search", "redirs=1", "advanced=1", "fulltext=Advanced+search", "search=Ruby"] |
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 canvas = document.getElementById("c"); | |
var context = canvas.getContext("2d"); | |
// Draw a circle | |
context.beginPath(); | |
context.arc(75,75,50,0,Math.PI*2,true); | |
context.stroke(); |
NewerOlder