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
require "http/server" | |
server = HTTP::Server.new(8080) do |context| | |
context.response.content_type = "text/plain" | |
context.response.print "Hello world at #{Time.now}" | |
end | |
puts "Listening on http://0.0.0.0:8080" | |
server.listen |
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
# The customary Hello World program in Crystal | |
puts "Hello World!" |
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
x = [[1], [2, 3, [4, 5, 6, [7, 8, 9, 10], 11], 12, 13], 14, 15, 16] | |
class Array | |
def flattener | |
matches = self.to_s.scan(/\d+/) | |
matches.collect(&:to_i) | |
end | |
end | |
puts "Specs" |