Skip to content

Instantly share code, notes, and snippets.

View epost's full-sized avatar

Erik Post epost

View GitHub Profile
.cpu 6502
* = $c000
start
inc $d020
inc $d021
jmp start
@epost
epost / Main.purs
Last active August 28, 2017 17:00
Sprite editor in PureScript (for use with TryPurescript + 'behaviors' backend)
module Main where
import Prelude
import Color (Color(..), black, white, lighten)
import Color.Scheme.MaterialDesign (blueGrey, green, red, yellow)
import Control.Monad.Eff (Eff(..))
import Data.Array ((..), cons, take, drop, mapWithIndex, length, index)
import Data.Foldable (class Foldable, foldMap, fold)
import Data.Int (toNumber, ceil, round, floor)
@epost
epost / Main.purs
Created July 9, 2017 19:28
purecript-crud-1
module Main where
import Prelude
import Control.Monad.Free
import Data.Exists
import Data.Foldable (fold)
import Data.Maybe
import Data.Symbol
import TryPureScript
@epost
epost / Main.purs
Last active August 30, 2017 13:34
Spreadsheet visualisation in PureScript Thermite
module Main where
import Prelude
import Control.Monad ((=<<))
import Data.Array (mapWithIndex, index, cons)
import Data.Lens (iso)
import Data.Foldable (sum)
import Data.Maybe
import React as R
@epost
epost / aql-mode.el
Last active June 15, 2017 00:13
emacs mode for AQL specifications
;; Usage:
;; `(add-to-list 'auto-mode-alist '("\\.aql\\'" . aql-mode))`
;;
;; References:
;; - http://www.wilfred.me.uk/blog/2015/03/19/adding-a-new-language-to-emacs/
;; - https://www.emacswiki.org/emacs/EmacsSyntaxTable
(defconst aql-mode-syntax-table
(let ((table (make-syntax-table java-mode-syntax-table)))
;; # is punctuation, but // is a comment starter
@epost
epost / Main.purs
Last active June 12, 2017 13:15
Sprite editor in PureScript (for use with try-thermite)
module Main where
import Prelude
import Data.Array
import Data.Foldable
import Data.Traversable (for)
import Data.Maybe
import Data.Int (toNumber)
import React as R
@epost
epost / Main.purs
Created June 10, 2017 23:02
PureScript Thermite agenda (TryThermite)
module Main where
import Prelude
import React as R
import React.DOM as R
import React.DOM (text, a, h1', p', div)
import React.DOM.Props as RP
import React.DOM.Props (style, onClick, href, target)
import Thermite hiding (defaultMain) as T
@epost
epost / Main.purs
Last active June 16, 2017 12:18
try-purescript sprites (flare backend)
module Main where
import Prelude
import Data.Array
import Data.Foldable
import Data.Int (toNumber)
import Data.Maybe
import Signal.DOM (animationFrame)
import Flare
import Flare.Drawing
@epost
epost / Main.purs
Last active November 2, 2018 18:06
Rawan programmeercursus
module Main where
import Prelude
import Control.Monad.Eff.Console (logShow, log)
import Data.Tuple
import Data.Map (Map, lookup, singleton)
import TryPureScript
main = render =<< withConsole do
var R = require('ramda')
var FV = require('fantasy-validations')
var DV = require('data.validation') // folktale
var V = FV
// extend with flatten and chain
V.prototype.flatten = function () {
return this.f ? this : this.s // TODO use fold
}