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
; A monad comprehension is a syntactic construct that translates | |
; synchronous-looking code into a callback-based implementation. Monads | |
; are a very general abstraction - which means that monad comprehensions | |
; have more expressive power than other sync-to-async code | |
; transformations. | |
; Here is an example that uses jQuery's $.get method to fetch resources: | |
(def post-with-author (id) | |
(for |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
if ["--help", "help", "-h"].include?(ARGV[0]) || ARGV.size < 1 | |
puts "Usage: #{File.basename __FILE__} ( 540p | 540i | 360p | 360i | 360is | 224p )" | |
exit 0 | |
end | |
size_hash = {"540p" => "2540", "540i" => "1840", "360p" => "1240", "360i" => "0640", "360is" => "0440", "224p" => "0240"} | |
video_size = size_hash[ARGV[0]] |
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
# If I could design my own language, it would look something like this. | |
# | |
# + Indentation matters instead of curly braces. | |
# + Nothing but | |
# - Functions | |
# - Lists | |
# + Predefined types | |
# - Number = | |
# + = (Number) | |
# - = (Number) |