Skip to content

Instantly share code, notes, and snippets.

{-# OPTIONS_HADDOCK ignore-exports #-}
module DirTree where
import Control.Applicative
import Control.Exception.Base(IOException)
import Data.Ord (comparing)
import Data.List (sort, sortBy, (\\))
import Data.Time.Clock
import Data.Word
@ruby0x1
ruby0x1 / msdf.glsl
Last active February 13, 2022 05:30
simple MSDF shader
float r = sample.r;
float g = sample.g;
float b = sample.b;
float median = max(min(r, g), min(max(r, g), b));
float signed_dist = median - 0.5;
float d = fwidth(signed_dist);
float opacity = smoothstep(-d, d, signed_dist);
//apply opacity to final alpha
color.a *= opacity;
@hcarvalhoalves
hcarvalhoalves / type.scm
Created February 26, 2020 12:03
minikanren type inference
;;; WEB -- 18 June 2016
;; Type inferencer in miniKanren, adapted from Oleg's Kanren polymorphic type inferencer
;;
;; http://kanren.cvs.sourceforge.net/viewvc/kanren/kanren/examples/type-inference.scm?view=markup
;;
;; Unlike the Kanren inferencer, this definition of !- is a pure
;; relation, with no cuts and no uses of project. This inferencer
;; also does not require a parser/unparser, and allows shadowing.