Skip to content

Instantly share code, notes, and snippets.

@baileyparker
baileyparker / README.md
Last active February 10, 2016 03:39
OCaml doctest-ish script

Doctest-ish for Ocaml

Useful for asserting test cases for EN.600.426 without all that copy 'n paste and visual comparing.

The code is admittedly sloppy and makes some fragile assumptions. It errors very easily and can't assert exceptions. It expects doctests of the form:

(*
# foo param another_one and_another_one;;
- : bytes list = ["major"; "key"]

*)

@baileyparker
baileyparker / BankAcct.js
Created October 4, 2015 22:46
OO Javascript Example
var BankAcct = (function() {
// The BankAcct function will execute when it is new'ed,
// so this.name and this.balance will be set
function BankAcct(name) {
this.name = name;
this.balance = 100; // starting money
}
// These functions will be available on any new BankAcct() objects
BankAcct.prototype.changeName = function(newName) {