Skip to content

Instantly share code, notes, and snippets.

@constfun
constfun / .depend
Created June 6, 2020 02:07 — forked from keigoi/.depend
session type in ocaml (proof-of-concept impl.)
channel.cmi :
mVar.cmi :
monitor.cmi :
session.cmi :
channel.cmo : monitor.cmi channel.cmi
channel.cmx : monitor.cmx channel.cmi
example.cmo : session.cmi
example.cmx : session.cmx
mVar.cmo : monitor.cmi mVar.cmi
mVar.cmx : monitor.cmx mVar.cmi
@constfun
constfun / coroutine.ml
Created June 6, 2020 02:01 — forked from keigoi/coroutine.ml
Coroutine implementation in OCaml, with Oleg's delimited continuation. see http://okmij.org/ftp/continuations/implementations.html#caml-shift
(* Coroutine implementation in OCaml, with Oleg's delimited continuation *)
(* see http://okmij.org/ftp/continuations/implementations.html#caml-shift *)
module D = Delimcc
(* Coroutine yielded a value of type 'a, and will resume with some value of type 'b *)
type ('a, 'b) suspend =
| Cont of 'a * ('b, ('a,'b) suspend) D.subcont
| Finish
let start_coroutine f =
Replenish
Authenticate
Authenticated -> Assign Batch
Assign Batch
@constfun
constfun / artification-webtask.js
Last active December 13, 2017 03:47
Email Aritifcation for webtask.io
'use latest';
// This code is a webtask for https://webtask.io
// It can be used send email notifications with some random art in it.
// Use it with IFTTT.com for full effect.
// POST to this webtask with the following URL params:
// to - (required) destination Email
// subject - (required) subject line
// text - (optional) additional text to attach to the email body, may include escaped HTML
@constfun
constfun / ips.py
Last active November 23, 2015 17:22 — forked from anonymous/python
Save pings
import os
import time
os.system("clear")
def savePing(rotation):
ip_address_list = []
watch-jsx:
jsx --watch --extension jsx src/jsx src/js &
watch-scss:
sass --watch src/scss:src/css &
build:
jsx --extension jsx src/jsx src/js
sass --update src/scss:src/css
def make_numbers_list(limit):
i = 0
numbers = []
while i < limit:
print "At the top i is %d" % i
numbers.append(i)
i += 1
print "Numbers now: ", numbers
open Core.Std
(* See: http://en.wikipedia.org/wiki/Linear_interpolation *)
let linear_interpolation (px, py) x (nx, ny) =
let y = (Float.of_int py) +.
(Float.of_int (ny - py)) *.
(Float.of_int (x - px)) /. (Float.of_int (nx - px)) in
(x, y)
# You can also import for the format that secrets itself uses.
Gmail
password: 1235
LinkedIn
username: stopspammingme
password: 56787
...
# The first line is the heading, the rest are data.
# You can add more colums. Each column must be tab separated.
title password ...
gmail 12345 ...
linkedin 6578 ...
something really long 2134567 ...
# Once you have that in a file, you can import it: