Skip to content

Instantly share code, notes, and snippets.


Willem van den Ende mostalive

View GitHub Profile
mostalive / Main.purs
Last active Jul 1, 2020
Bucket constraint example from the Domain-Driven Design book, in purescript with hopefully a twist (work in progress)
View Main.purs
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (logShow)
import TryPureScript (render, withConsole)
import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..))
mostalive / gist:54dbbf388f6ca58795d6ae37fef22890
Created May 24, 2017
Bash script to create package description to include in purescript 'package-set'. Automatically retrieves git repository url and latest tag. Doesn't do formatting yet, and generates one trailing
View gist:54dbbf388f6ca58795d6ae37fef22890
echo 'usage: <packagename>'
set -euo pipefail
REPO=`git remote get-url origin`
VERSION=`git tag | tail -n 1`
echo "\"$1\": {"
mostalive / Loadable.purs
Last active May 22, 2017
Loadable state of an object in my pux application (under construction - sketch)
View Loadable.purs
-- Loadable
-- Thanks to @karls - full implementation would probably be...
-- i stands for identifier, e.g. a schema or a number, or whatever else is needed to load or index it
-- kind of a 'maybe'.
-- o is for object. Only in the Loaded state is the object available
-- example ```
-- showLoaded Loaded id object = show object
-- showLoaded _ = "Object not loaded"
-- ```
View bumpme
Fri Mar 24 12:38:56 UTC 2017
View Client.purs
module Client where
import Prelude (bind, return)
import Pux (App, Config, CoreEffects, start, renderToDOM)
import Control.Bind ((=<<))
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
mostalive / Main.purs
Last active Jun 15, 2016
Purescript - remove exception in Aff
View Main.purs
module Main where
import Prelude (($), bind,id, pure)
import Control.Monad.Eff.Exception (Error, EXCEPTION, catchException, message)
import Control.Monad.Aff (Aff, attempt)
import Control.Monad.Aff.Unsafe (unsafeInterleaveAff)
import Data.Either (either)
catchException' :: forall e a. (Error -> a) -> Aff (err :: EXCEPTION | e ) a -> Aff e a
catchException' handler f = do
mostalive / Calc.hs
Last active Aug 29, 2015
Form validation with Reflex FRP in haskell
View Calc.hs
{- Based on .
This is the try Reflex calculator example modified
to collect the two numbers and an operator into a Maybe Calculation.
So we use the validation for each field to validate the form as a hole.
This could be useful to build forms for e.g. an admin interface. -}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE TemplateHaskell #-}
View Enemyhorde.lua
EnemyHorde = class()
function EnemyHorde:init()
    -- you can accept and set parameters here
    self.frame = 0
    self.units = {} -- enemy units
    self.heroBullets = {} -- hero's bullets
mostalive / Main.lua
Created Mar 7, 2012 — forked from anonymous/Main.lua
Space invaders main file
View Main.lua
hero = nil
enemies = nil
bgLines = nil
explosion = nil
mostalive / default.vcl
Created Dec 17, 2010
varnish cache server configuration file, used with drupal 6 and apache
View default.vcl
#varnish cache server configuration file, used with drupal 6 and apache
#inspiration from
#with change from obj to beresp of
#and cache HIT or MISS header from somewhere else
backend default {
.host = "";
.port = "80";
.connect_timeout = 600s;
.first_byte_timeout = 600s;