Skip to content

Instantly share code, notes, and snippets.

Patricio M. Ros pmros

Block or report user

Report or block pmros

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
pmros / README.md
Last active Aug 15, 2016
Submission app in CycleJS with most using a state store driver.
View README.md
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
pmros / README.md
Last active Nov 29, 2015
pamatcher demo
View README.md

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

@alexspeller
alexspeller / base64encode.js.coffee
Last active Dec 21, 2015
Ember Table Extensions
View base64encode.js.coffee
# 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] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
You can’t perform that action at this time.