Skip to content

Instantly share code, notes, and snippets.

View pbouzakis's full-sized avatar

Paul Bouzakis pbouzakis

View GitHub Profile
@pbouzakis
pbouzakis / index.js
Created November 18, 2014 03:20
requirebin sketch
// Prototype of task guard implemented in a more functional style.
var Promise = require("q").Promise;
var pipeline = require("fn.js").pipeline;
var partial = require("fn.js").partial;
// STATE OF THE WORLD, CHANGES GO HERE:
var STATE;
function createState(isDisposed) {
@pbouzakis
pbouzakis / index.js
Created November 18, 2014 15:07
requirebin sketch
// Prototype of task guard implemented in a more functional style.
var Promise = require("q").Promise;
var pipeline = require("fn.js").pipeline;
var partial = require("fn.js").partial;
// STATE OF THE WORLD, CHANGES GO HERE:
var STATE;
function createState(isDisposed) {
@pbouzakis
pbouzakis / index.js
Created November 18, 2014 16:40
requirebin sketch
var compose = require("fn.js").compose;
var pipeline = require("fn.js").pipeline;
var partial = require("fn.js").partial;
var insertCss = require("insert-css");
insertCss("body { padding: 20px } \
.selected { font-weight: bold; color: red; font-family: Consolas; font-size: 18px; }\
.important { color: blue }");
// string, string returns DomElement
@pbouzakis
pbouzakis / tennis_kata.ml
Last active November 22, 2017 18:28
OCaml Tennis Kata
(* Tennis Kata in OCaml! *)
type player = PlayerOne | PlayerTwo
type point = Love | Fifteen | Thirty
type score =
| Points of point * point
// OOPS VIOLATION OF LISKOV!! Bad bad
Rectangle {
width(val) = _width = val
height(val) = _height = val
area() = width() * height()
}
test_area(rect: Rectangle) {
rect.width(4)