Skip to content

Instantly share code, notes, and snippets.

  • Save on laptop

    • If I'm on branch vertex, fork off vertex-tmp-*, if I'm alredy on these do nothing
    • Commit w/o real msg
  • Whenever I say "test" (or save)

    • Push the current (tmp branch) to strats1
      • This has to be configured to listen to vertex-NAME-HIGHERST-N, or something
    • On strats1, check out and build (aborting previous builds)
      • (When build finishes update cluster state)
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.65.7733&rep=rep1&type=pdf
http://sandervanderburg.blogspot.co.uk/2011/02/disnix-toolset-for-distributed.html
http://cis.upenn.edu/~cis194/spring15/lectures/11-stlc.html
https://typesandkinds.wordpress.com/
https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-Type-Equality.html
https://gist.github.com/gavinwahl/0e5e82efdb9a75ad78ce
:set -XOverloadedStrings
:set prompt "> "
:set -W
:set -fno-warn-unused-binds
:set -fno-warn-unused-matches
:set -fno-warn-unused-do-bind
:set -fwarn-unused-imports
:set -Werror
local :: (MonadState s m, Applicative m) => (s -> s) -> m b -> m b
local f k = do
s1 <- get
modify f
r <- k
put s1
pure r
{-
In a nutshell, we can't do a good blocking request based on underlyingBlockRequst
without a predicate as:
- The only thing we are subscribing to is updates, not updates satisfying some property.
Thus before entering into a long blocking requst, we should evaluate whether we already
@hanshoglund
hanshoglund / SignalP.hs
Created December 7, 2016 12:16
SignalP.hs
newtype Signal' a = Signal' { runSignal' :: Compose FRP Signal a }
-- Applicative
newtype Behavior' a = Behavior' { runBehavior' :: Compose FRP Behavior a }
-- Applicative
@hanshoglund
hanshoglund / promiseWrap.hs
Last active November 13, 2016 22:30
promiseWrap.hs
{- stack
--resolver lts-5.5
--install-ghc
runghc
-}
{-# LANGUAGE ScopedTypeVariables, TupleSections #-}
import Data.IORef
For this to work, I patch my local env with this diff: `git diff master...hans-testing-bs` using `git merge —squash hans-testing-bs`
Get new prod env like this (DB, deploy, ghcjs/build env)
Create DB and prod container (running)
./buildbits/bin/buildosaurus beautilytics-browsable-cli
Create ghcjs-env
DO="" ./buildbits/bin/c $(cat .builder/image-id/ghcjs-env)
In ghcjs-env container, I rebuild the platform with (from src/b/beautilytics)
SHAKEOPTS=--fast make dpkg STACKOPTS="--fast -j4"
@hanshoglund
hanshoglund / canvas-example.js
Created September 8, 2016 17:19
canvas-example.js
// State
var canvas = document.getElementById('canvas');
var c = canvas.getContext('2d');
// console.log(c)
function drawCircle(c,x,y,rad,col) {
c.beginPath();
c.arc(x,y,rad, 0, 2 * Math.PI, false);
c.fillStyle = col || 'red';
c.fill();
@hanshoglund
hanshoglund / IndexMerge.hs
Created August 30, 2016 11:51
BD index app
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC
-fwarn-incomplete-patterns
-fno-warn-name-shadowing
-fno-warn-unused-binds
-fno-warn-unused-matches