No more wondering, "How does this compile?"
This file contains hidden or 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
wat : Nat -> Nat | |
wat (S k) = k | |
/* | |
*wat> wat 1 | |
0 : Nat | |
*wat> wat 2 | |
1 : Nat | |
*wat> wat 3 | |
2 : Nat |
This file contains hidden or 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 'metriks/reporter/librato_metrics' | |
require 'socket' | |
prefix = ENV.fetch('LIBRATO_METRICS_PREFIX') do | |
ENV['RACK_ENV'] unless ENV['RACK_ENV'] == 'production' | |
end | |
app_name = ENV.fetch('DYNO') do | |
# Fall back to hostname if DYNO isn't set. | |
require 'socket' |
This file contains hidden or 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
one x = 1 | |
one :: α → num | |
apply f x = f x | |
f :: (α → β) | |
x :: α | |
apply :: (α → β) → α → β | |
compose f g x = f(g x) | |
f :: (α → β) |
This file contains hidden or 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
$ 'thing' | |
.on 'submit', (e) -> | |
new Spinner | |
length: 5 | |
.spin() | |
console.log 'submit' | |
# // Generated by CoffeeScript 1.7.1 | |
# $('thing').on('submit', function(e) { | |
# return new Spinner({ |
This file contains hidden or 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
at_exit { puts 'at_exit1' } | |
puts 1 | |
END { puts 'end' } | |
BEGIN { puts 'begin' } | |
puts 2 | |
at_exit { puts 'at_exit2' } | |
# Output: | |
# begin | |
# 1 |
This file contains hidden or 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 jump_proc | |
proc { return 42 }.call | |
raise "here" | |
end | |
jump_proc #=> 42 | |
def jump_lamb | |
lambda { return 42 }.call | |
raise "here" | |
end |
This file contains hidden or 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
begin | |
Proc.new { return 42 }.call | |
rescue LocalJumpError => e | |
puts "LocalJumpError: exit_value=#{e.exit_value}" | |
end | |
#=> "LocalJumpError: exit_value=42" |
The new Cloud.app includes basic AppleScripting support to upload files and text and create bookmarks. This is a work in progress. If theres's something you'd like to do, please get in touch.
The upload command supports a file or text. If you send a file
object, it
uploads the file at the path. If you send text, it uploads the text as a new
This file contains hidden or 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 'thread' | |
class EnumerableQueue | |
attr_reader :jobs, :poison, :finished_lock, :finished, :pool_size | |
def initialize(pool_size = 1) | |
@jobs = Queue.new | |
@results = Queue.new | |
@poison = Object.new | |
@finished_lock = Mutex.new |