Skip to content

Instantly share code, notes, and snippets.

View tmaeda's full-sized avatar

tmaeda

  • Enishi Tech Inc.
  • Sapporo, Japan
View GitHub Profile
@yminsky
yminsky / Plotting sine and cosine with c3 and js_of_caoml
Created June 19, 2015 02:33
Plotting sine and cosine with c3 and js_of_ocaml
let get_by_id id =
let d = Dom_html.document in
Js.Opt.get (d##getElementById (Js.string id))
(fun () -> assert false)
let rec range i n =
if i >= n then [] else i :: range (i + 1) n
let base =
range 0 100
@sandinist
sandinist / fibcalc.exs
Created April 4, 2014 08:22
るびまのElrangサンプルコードにあがっていたmodule(fibcalc)をElixirにしてみた(等価ではない) http://magazine.rubyist.net/?0017-Legwork
defmodule Fibcalc do
def calc_fibs(list) do
list
|>
Enum.map(fn (elem) ->
spawn fn -> IO.puts "fib(#{elem}) = #{Fibcalc.fib(elem)}" end
end)
end
def fib(0), do: 1
def fib(1), do: 1
@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)