Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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
@yminsky
yminsky / foo.ml
Created January 8, 2016 01:33
better formatting
let rec lexwhile prop inp =
match inp with
| c::cs when prop c -> let tok,rest = lexwhile prop cs in c^tok,rest
| _ -> "",inp
;;
let rec lex inp =
match snd(lexwhile space inp) with
| [] -> []
@yminsky
yminsky / foo.ml
Created January 8, 2016 01:38
yet better formatting
let rec lexwhile prop inp =
match inp with
| c::cs when prop c ->
let (tok,rest) = lexwhile prop cs in
(c^tok,rest)
| _ -> ("",inp)
;;
let rec lex inp =
@yminsky
yminsky / foo.ml
Created January 8, 2016 01:39
OCD kicking in now
let rec lexwhile prop inp =
match inp with
| c::cs when prop c -> let tok,rest = lexwhile prop cs in c^tok,rest
| _ -> "",inp
;;
let rec lex inp =
match snd(lexwhile space inp) with
table server : { Temperature : float,
Uptime: int }
task initialize = fn () =>
dml (DELETE FROM server WHERE TRUE);
dml (INSERT INTO server(Temperature, Uptime) VALUES({[0.0]}, {[0]}))
style selected
val main : transaction page =
{
"tagName": "body",
"properties": {
},
"children": [
{
"tagName": "div",
"properties": {
{
"tagName": "body",
"properties": {
},
"children": [
{
"tagName": "div",
"properties": {
{
"23": [
{
"type": 6,
"vNode": null,
"patch": {
"tagName": "tr",
"properties": {
},
{
"children": [
{
"children": [
{
"text": "Search:"
},
{
"children": [
{
This file has been truncated, but you can view the full file.
{
"children": [
{
"children": [
{
"text": "Search:"
},
{
"children": [
{