Skip to content

Instantly share code, notes, and snippets.

View Main.purs
module Main where
import Control.Monad.Eff (Eff)
import Data.Maybe (fromJust)
import Data.Tuple (Tuple(..))
import Graphics.Canvas (CANVAS, Context2D, closePath, getCanvasElementById,
getContext2D, lineTo, moveTo, setLineWidth, strokePath)
import Math (cos, pi, sin)
import Partial.Unsafe (unsafePartial)
import Prelude (Unit, bind, discard, negate, void, ($), (*), (+), (-), (/), (<=))
pmros /
Last active Aug 15, 2016
Submission app in CycleJS with most using a state store driver.
View coffeetable.js
"use strict"
var usage = "sjs -l ./coffeetable.js ./examplescript.js"
var indentToBraces = (chr, reader, prevTokens) => {
var punc = reader.readPunctuator();
// record the whitespace at the start of the current line
var indentFinder = /\s*/g;
var i = indentFinder.lastIndex = reader.lineStart;
pmros /
Last active Nov 29, 2015
pamatcher demo

pamatcher is a pattern matching library for JavaScript iterators. Example of use in browser.

alexspeller /
Last active Dec 21, 2015
Ember Table Extensions
# So, this is pretty horrible. If we just encode using btoa, any UTF-8 chars cause an error.
# If we use either of the workarounds on MDN[1], the £ sign is encoded wrong. I suspect
# Excel totally sucking at encodings is the reason why. So, the workaround is, to use
# the MDN workaround on chars with values > 255, and allow chars 0-255 to be encoded
# as is with btoa. Note that if you use either of the workarounds on MDN, chars
# 128-255 will be encoded as UTF-8, which includeds the £ sign. This will cause excel
# to choke on these chars. Excel will still choke on chars > 255, but at least the £
# sign works now...
# [1]