Skip to content

Instantly share code, notes, and snippets.

@iamvery
iamvery / Chat.elm
Last active July 11, 2017 15:54
Elm with a React head, cause why not?
port module Chat exposing (main)
-- https://github.com/elm-lang/core/issues/703
import Json.Decode
import WebSocket
port messages : List String -> Cmd msg

Run the example.

$ ruby pipes.rb
FOO
BAR
$
returns = ->(type) {
->(func) {
->(*args) {
func.(*args).tap { |result|
raise ArgumentError unless result.is_a?(type)
}
}
}
}
RSpec.describe "lolrubby" do
def lol
wat = "haha",
wat.upcase
end
it "is silly sometimes" do
expect(lol).to eq("HAHA") # fails... lol
end
end
koan "New processes are spawned functions" do
value = spawn(fn -> nil end)
assert is_pid(value) == true
end
koan "Processes die when their function exits" do
pid = spawn(fn -> nil end)
# The spawned function executes concurrently with the current process. So
@iamvery
iamvery / Gemfile
Last active February 17, 2017 14:55
source "https://rubygems.org"
gem "activerecord"#, "4.2.7.1"
gem "sqlite3"
@iamvery
iamvery / Gemfile
Last active February 1, 2017 16:39
source "https://rubygems.org"
gem "sqlite3"
gem "activerecord"
gem "rspec"
# https://www.reddit.com/r/osx/comments/52zn5r/difficulties_with_sshagent_in_macos_sierra/
Host *
UseKeychain yes

Keybase proof

I hereby claim:

  • I am iamvery on github.
  • I am iamvery (https://keybase.io/iamvery) on keybase.
  • I have a public key whose fingerprint is E3B0 4866 E720 F3F5 1121 CA5A 0C54 C2C7 C663 368F

To claim this, I am signing this object:

class Object
def extract(*messages)
messages.map(&method(:public_send))
end
end
RSpec.describe Object do
Foo = Struct.new(:bar, :baz)
describe "#extract" do