Skip to content

Instantly share code, notes, and snippets.

View hmm.rb
class String
def my_reverse
reversed = []
self.each_char do |char|
reversed.unshift(char)
end
reversed.join('')
end
end
View gist:904394
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
</web-app>
View Evolution of a Groovy programmer.groovy
// Newbie programmer
int factorial_newbie(int n) {
if (n == 0) {
return 1
} else {
return n * factorial_newbie(n - 1)
}
}
println factorial_newbie(6)