From 52f86ea0075c66e18e4796ad88f45541da8b4de5 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 7 Mar 2019 23:26:17 +0100 Subject: some cleanup and such --- .../00010_Links-and-Notes-and-Literature/index.md | 36 +++ 080_blog/00040_Haskell/00040_Graham-Scan/index.md | 128 ++++++++ .../00040_Haskell/00065_Base64-Encoder/base64.cast | 322 +++++++++++++++++++++ .../00040_Haskell/00065_Base64-Encoder/index.md | 19 ++ .../00040_Haskell/00120_Lambda-Calculus/index.md | 38 +++ .../00130_Calculator-on-Parsec-and-GTK/index.md | 23 ++ .../00140_Minimalistic-SVG-Generator/index.md | 31 ++ .../00140_Minimalistic-SVG-Generator/svg.png | Bin 0 -> 13130 bytes .../00150_Applicative-vs-Monadic-Parsing/index.md | 1 + .../00200_Estatico-Page-Maker/index.md | 55 ++++ 080_blog/00040_Haskell/index.md | 8 + 11 files changed, 661 insertions(+) create mode 100644 080_blog/00040_Haskell/00010_Links-and-Notes-and-Literature/index.md create mode 100644 080_blog/00040_Haskell/00040_Graham-Scan/index.md create mode 100644 080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast create mode 100644 080_blog/00040_Haskell/00065_Base64-Encoder/index.md create mode 100644 080_blog/00040_Haskell/00120_Lambda-Calculus/index.md create mode 100644 080_blog/00040_Haskell/00130_Calculator-on-Parsec-and-GTK/index.md create mode 100644 080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/index.md create mode 100644 080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/svg.png create mode 100644 080_blog/00040_Haskell/00150_Applicative-vs-Monadic-Parsing/index.md create mode 100644 080_blog/00040_Haskell/00200_Estatico-Page-Maker/index.md create mode 100644 080_blog/00040_Haskell/index.md (limited to '080_blog/00040_Haskell') diff --git a/080_blog/00040_Haskell/00010_Links-and-Notes-and-Literature/index.md b/080_blog/00040_Haskell/00010_Links-and-Notes-and-Literature/index.md new file mode 100644 index 0000000..6e82b3b --- /dev/null +++ b/080_blog/00040_Haskell/00010_Links-and-Notes-and-Literature/index.md @@ -0,0 +1,36 @@ +# Haskell + +## Books, Links and Papers + +* **Learn You a Haskell** for Great Good by Marian Lipovaca +* **Real World Haskell** by Bryan O'Sullivan, Don Stewart, and John Goerzen +* **Parallel and Concurrent Programming in Haskell** by Simon Marlow + +* **Haskell Wiki** https://wiki.haskell.org +* **UPENN CIS 194** https://www.seas.upenn.edu/~cis194/spring13/ +* **What I Wish I Knew When Learning Haskell** by Stephen Diehl +* **Data61 Course** https://github.com/data61/fp-course + +* **Monads for functional programming (paper)** by Philip Wadler +* **Functional Pearl (paper)** +* **Why Functional Programming Matters (paper)** + +* **Mailing Lists** https://www.haskell.org/mailing-lists/ +* **IRC** #haskell at chat.freenode.at +* **Monadic Warsaw** + + +## Xmonad + +My little contribution to xmonad-contrib: + +* Added pretty printer for empty visible workspaces (wrapped in Maybe) + https://github.com/xmonad/xmonad-contrib/pull/241 + +## GHC Flags (TODO: put here all the other flags I have documentend in this Makefile somweher :P ) + -gq ? + +## monad transformers in action + + Main Control.Monad.Writer Control.Monad.State> runState (runWriterT (get >>= \a -> tell ["foo"] >> put (a*a) >> tell ["bar"] >> tell [show a])) 5 + diff --git a/080_blog/00040_Haskell/00040_Graham-Scan/index.md b/080_blog/00040_Haskell/00040_Graham-Scan/index.md new file mode 100644 index 0000000..195dbe1 --- /dev/null +++ b/080_blog/00040_Haskell/00040_Graham-Scan/index.md @@ -0,0 +1,128 @@ +Haskell – Convex Hull – Graham Scan +=================================== + +December 16, 2017 + +Playing with Convex Hulls (via Graham Scan) and SVG Export in Haskell: + +This is an embedded SVG generated by the Haskell programm below: + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +--------------------------------------------------------------------------------------------- +-- +-- GRAHAM SCAN IMPLEMENTATION +-- +-- This little haskell programm calulates the Convex Hull for a set of 2D points. +-- It ships wit a main function that feeds the Graham Scan algorithm with some +-- random points and generates a simple SVG of the input points and resulting envelope. +-- A simple SVG encoder is included. +-- +-- Alogrithm used: https://en.wikipedia.org/wiki/Graham_scan +-- +-- CREDITS -- +-- +-- Michal Idziorek +-- 16 December 2017 +-- +--------------------------------------------------------------------------------------------- + +import Data.List +import System.Random + +--------------------------------------------------------------------------------------------- + +-- GRAHAM SCAN -- + +-- Three points are clockwise if ccw < 0. +ccw (p1x,p1y) (p2x,p2y) (p3x,p3y) = (p2x - p1x)*(p3y - p1y) - (p2y - p1y)*(p3x - p1x) + +-- Calculate the slope defined by 2 points. (return Infinity, if points are identical). +slope (ax,ay) (bx,by) | (ax,ay ) == (bx,by) = 1/0 -- Infinity + | otherwise = (bx-ax)/(by-ay) + +-- Comparison function to sort points counterclockwise (given a reference point). +slope_cmp a b c = compare (slope a c) (slope a b) + +-- Comparison function using the y and x coordinates for ordering. +graham_cmp (ax,ay) (bx,by) | ay /= by = compare ay by + | otherwise = compare ax bx + +-- Graham scan on prepared data. this will calculate the convex hull. +graham_calc [] hs = hs +graham_calc (x1:xs) hh | length(hh) < 2 = graham_calc xs (x1:hh) +graham_calc xx@(x1:xs) hh@(h1:h2:hs) | ccw x1 h1 h2 < 0 = graham_calc xs (x1:hh) + | otherwise = graham_calc xx (h2:hs) + +-- Find the starting point, sort all points counterclockwise and perform the graham scan. +graham xs = graham_calc sortedPoints [] + where minPoint = minimumBy graham_cmp xs + sortedPoints = sortBy (slope_cmp minPoint) xs + +--------------------------------------------------------------------------------------------- + +-- XML ENCODING-- + +xml_attr (x:xs) = x++"=\""++(head xs)++"\" " +xml_enc tag attrs body = "<"++tag++" "++xml_attrs++">"++body++"" + where xml_attrs = unlines $ map xml_attr attrs + +-- SVG ENCODING -- + +-- hardcoded scaling and panning function +svg_transf x = x*30+5 + +line_to_svg ((x1,y1),(x2,y2)) = xml_enc "line" [["x1",show lx1],["y1",show ly1], + ["x2",show lx2],["y2",show ly2], + ["style", "stroke:rgb(255,0,0);stroke-width:2"]] "" + where lx1=svg_transf x1 + lx2=svg_transf x2 + ly1=svg_transf y1 + ly2=svg_transf y2 + +point_to_svg (x,y) = xml_enc "circle" [["cx",show cx],["cy",show cy],["r","5"], + ["fill","rgb(30,150,"++(show (floor dist))++")"]] "" + where cx=svg_transf x + cy=svg_transf y + dist= (sqrt ((x-5)*(x-5) + (y-5)*(y-5)))*255/8 + + + +-- draws SVG points and lines (in hardcoded sizes and colors) +svg_draw p l = xml_enc "svg" [style,["width","330"],["height","330"]] body + where style = ["style", + "background-color:black;border:3px solid green;margin:2px;"] + body = (unlines (map point_to_svg p )) ++ + (unlines (map line_to_svg l )) + +-- calculate convex hull and generate svg +svg_graham xs = svg_draw xs (zip hull hull_open) + where hull_open = graham xs + hull = (last hull_open) : hull_open + +-- RANDOMIZING -- + +randomPoints g cnt = take cnt (zip r10a r10b) + where r5 = randomRs (0,5) g :: [Double] + r10a =zipWith (+) r5 (drop cnt r5) + r10b =zipWith (+) (drop (2*cnt) r5) (drop (3*cnt) r5) + +--------------------------------------------------------------------------------------------- + +-- MAIN -- + +-- Note that this is the only place of impurity in this source-file. +-- Is is subject to side effects due to I/O (we are writng to stdout) +-- and the random number generator. +main = do + g <- newStdGen + putStr (svg_graham (randomPoints g 25)) + putStr (svg_graham (randomPoints g 50)) + putStr (svg_graham (randomPoints g 100)) + putStr (svg_graham (randomPoints g 250)) + putStr (svg_graham (randomPoints g 500)) + putStr (svg_graham (randomPoints g 1500)) + +--------------------------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast b/080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast new file mode 100644 index 0000000..63fece1 --- /dev/null +++ b/080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast @@ -0,0 +1,322 @@ +{ + "duration": 14.820928, + "title": null, + "env": { + "SHELL": "/bin/bash", + "TERM": "screen-256color" + }, + "width": 106, + "stdout": [ + [ + 0.019966, + "miguel@megaloman:~$ " + ], + [ + 1.524665, + "t" + ], + [ + 0.08111, + "h" + ], + [ + 0.095838, + "i" + ], + [ + 0.118019, + "s" + ], + [ + 0.086883, + " " + ], + [ + 0.089573, + "i" + ], + [ + 0.134283, + "s" + ], + [ + 0.096031, + " " + ], + [ + 0.114016, + "a" + ], + [ + 0.166151, + " " + ], + [ + 0.319094, + "l" + ], + [ + 0.195916, + "o" + ], + [ + 0.142042, + "c" + ], + [ + 0.139961, + "a" + ], + [ + 0.07801, + "l" + ], + [ + 0.081012, + " " + ], + [ + 0.094941, + "a" + ], + [ + 0.120898, + "s" + ], + [ + 0.107959, + "c" + ], + [ + 0.115993, + "i" + ], + [ + 0.137871, + "i" + ], + [ + 0.205335, + "n" + ], + [ + 0.108673, + "e" + ], + [ + 0.127436, + "m" + ], + [ + 0.123916, + "a" + ], + [ + 0.244565, + "\r\n" + ], + [ + 0.000482, + "bash: this: command not found\r\n" + ], + [ + 0.000346, + "miguel@megaloman:~$ " + ], + [ + 1.012884, + "this is a local asciinema" + ], + [ + 0.230737, + "\r\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C" + ], + [ + 0.140235, + "\u001b[1@e" + ], + [ + 0.097927, + "\u001b[1@c" + ], + [ + 0.188824, + "\u001b[1@j" + ], + [ + 0.000974, + "\u001b[1@o" + ], + [ + 0.421424, + "\b\u001b[1P" + ], + [ + 0.117902, + "\b\u001b[1P" + ], + [ + 0.208192, + "\u001b[1@h" + ], + [ + 0.115112, + "\u001b[1@ " + ], + [ + 0.012814, + "\u001b[1@o" + ], + [ + 0.295287, + "\r\n" + ], + [ + 0.000755, + "bash: ech: command not found\r\n" + ], + [ + 0.000509, + "miguel@megaloman:~$ " + ], + [ + 0.480858, + "ech othis is a local asciinema" + ], + [ + 0.192018, + "\r\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C" + ], + [ + 0.237975, + "\u001b[C" + ], + [ + 0.118994, + "\u001b[C" + ], + [ + 0.146091, + "\u001b[1P" + ], + [ + 0.348015, + "\u001b[1P" + ], + [ + 0.562446, + "\u001b[1@h" + ], + [ + 0.437804, + "\u001b[C" + ], + [ + 0.219332, + "\u001b[1@ " + ], + [ + 0.220637, + "\r\n" + ], + [ + 0.000486, + "this is a local asciinema\r\n" + ], + [ + 0.000206, + "miguel@megaloman:~$ " + ], + [ + 1.218406, + "m" + ], + [ + 0.079499, + "c" + ], + [ + 0.170894, + "\r\n" + ], + [ + 0.00735, + "\u001b[?1049h\u001b[?1h\u001b=" + ], + [ + 0.000586, + "\u001b[1;9r\u001b[4l\u001b(B\u001b)0\u001b[9;1H\u001b[m\u000f\u001b[37m\u001b[40m\u001b[m\u000f\u001b[39;49m\r \r\u001b[?1l\u001b>\u001b[?1049l\u001b[?1049h\u001b[?1h\u001b=" + ], + [ + 0.021657, + "\u001b[?1001s\u001b[?1002h\u001b[?1006h\u001b[?2004h" + ], + [ + 0.000429, + "\u001b[1;9r\u001b[4l\u001b(B\u001b)0\u001b[?1h\u001b=\u001b[m\u000f\u001b[39m\u001b[49m\u001b[1;9r\u001b[H\u001b[J\u001b[2;105H\u001b[1K \u001b[37m\u001b[40m|\u001b[2;106H" + ], + [ + 0.000193, + "\b\u001b[39m\u001b[49m\u001b[1K \u001b[37m\u001b[40m╗\u001b[2;106H" + ], + [ + 0.000114, + "\b\u001b[39m\u001b[49m\u001b[1K \u001b[37m\u001b[40m/\u001b[2;106H" + ], + [ + 0.000129, + "\b\u001b[39m\u001b[49m\u001b[1K \u001b[37m\u001b[40m╗\u001b[2;106H" + ], + [ + 0.000156, + "\u001b]0;mc [miguel@megaloman]:~\u0007\u001b>" + ], + [ + 0.000337, + "\u001b[7;1H\u001b[39m\u001b[49mHint: Want your plain shell? Press C-o, and get back to MC with C-o again.\u001b[7;106H" + ], + [ + 0.000251, + "\u001b]0;mc [miguel@megaloman]:~\u0007\u001b>" + ], + [ + 0.000102, + "\u001b[1;1H\u001b[30m\u001b[47m Left File Command Options Right \u001b[2;1H\u001b[37m\u001b[40m╔«═\u001b[97m\u001b[105m ~ \u001b[37m\u001b[40m═════════════════════════════════════════⋅[^]»╗╔«═ ~ ═════════════════════════════════════════⋅[^]»\r\n║\u001b[97m↑n Name \u001b[37m│\u001b[97m Size \u001b[37m│\u001b[97mModify time \u001b[37m║║\u001b[97m↑n Name \u001b[37m│\u001b[97m Size \u001b[37m│\u001b[97mModify time \u001b[37m║\u001b[4;1H╟───────────────────────────────────────────────────╢╟───────────────────────────────────────────────────╢\u001b[5;1H║UP--DIR ║║" + ], + [ + 1e-05, + "UP--DIR ║\u001b[6;1H╚═════════════════════════════════ 158G/234G (67%) ═╝╚═════════════════════════════════ 158G/234G (67%) ═╝\u001b[8;1H\u001b[39m\u001b[49mmiguel@megaloman:~$\u001b[84C\u001b[31m[^]\u001b[9;1H 1\u001b[97mHelp \u001b[31m 2\u001b[97mMenu \u001b[31m 3\u001b[97mView \u001b[31m 4\u001b[97mEdit \u001b[31m 5\u001b[97mCopy \u001b[31m 6\u001b[97mRenMov \u001b[31m 7\u001b[97mMkdir \u001b[31m 8\u001b[97mDelete \u001b[31m 9\u001b[97mPullDn \u001b[31m10\u001b[97mQuit \u001b[9;105H \b\u001b[4h \u001b[4l\u001b[8;21H" + ], + [ + 1.221371, + "\u001b[1;1H\u001b[39m \u001b[2;1H \u001b[3;1H \u001b[4;1H \u001b[5;1H \u001b[6;1H \u001b[7;1H \u001b[8;1H \u001b[9;1H \u001b[1;106H\u001b[?2" + ], + [ + 4.5e-05, + "004l\u001b[?1006l\u001b[?1002l\u001b[?1001r" + ], + [ + 0.000416, + "\u001b[?1l\u001b>\u001b[9;1H\u001b[m\u000f\u001b[39;49m\r \r\u001b[?1l\u001b>\u001b[?1049l\u001b[39;49m" + ], + [ + 0.000319, + "\r\n" + ], + [ + 0.001118, + "miguel@megaloman:~$ " + ], + [ + 0.791031, + "e" + ], + [ + 0.62602, + "\b\u001b[K" + ] + ], + "height": 9, + "command": null, + "version": 1 +} \ No newline at end of file diff --git a/080_blog/00040_Haskell/00065_Base64-Encoder/index.md b/080_blog/00040_Haskell/00065_Base64-Encoder/index.md new file mode 100644 index 0000000..0ede6cf --- /dev/null +++ b/080_blog/00040_Haskell/00065_Base64-Encoder/index.md @@ -0,0 +1,19 @@ +Miguel's Base64 Encoder +======================= + February 19, 2018 + +Coded on a winter afternoon to fully understand **base64 encoding** and play with +**Haskell**, which is always an indisputable pleasure. + +Coded in _big anger_, due to Nick's fairy tales about saving his encrypted binary +data in plain ASCII configuration files, featuring strange letters and +non-printable characters. :P + + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +{BEGIN:EMBED} +https://gitweb.softwarefools.com/?p=miguel/haskell.git;a=blob_plain;f=base64/base64.hs +{END:EMBED} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The above code was auto-fetched from: diff --git a/080_blog/00040_Haskell/00120_Lambda-Calculus/index.md b/080_blog/00040_Haskell/00120_Lambda-Calculus/index.md new file mode 100644 index 0000000..25c6b83 --- /dev/null +++ b/080_blog/00040_Haskell/00120_Lambda-Calculus/index.md @@ -0,0 +1,38 @@ +Lambda Calculus +=============== + + May 2, 2018 + +Playing with Type Quantifiers and Haskell's Rank 2 Type Polymorphsim, +implementing Boolean logic from scratch. We use the conventional +definitions for `True` an `False` also known as Church booleans, after Alonzo Church, who +intruced them along Lambda Calculus in the 1930s [1]. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +{-# LANGUAGE Rank2Types #-} + +fTrue :: forall a. a->a->a +fTrue x y = x + +fFalse :: forall a. a->a->a +fFalse x y = y + +fAnd :: (forall a. a->a->a)->(forall a. a->a->a)->(forall a. a->a->a) +fAnd p q = p q p + +fOr :: (forall a. a->a->a)->(forall a. a->a->a)->(forall a. a->a->a) +fOr p q = p p q + +fNot :: (forall a. a->a->a)->(forall a. a->a->a) +fNot p = p fFalse fTrue + +ifThenElse :: (forall a. a->a->a)->(forall a. a->a->a) + ->(forall a. a->a->a)->(forall a. a->a->a) +ifThenElse p a b = p a b + +-- Example -- + +main = print $ (ifThenElse fFalse fFalse $ fAnd fTrue $ fNot fFalse) "T" "F" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + [1] https://en.wikipedia.org/wiki/Lambda_calculus diff --git a/080_blog/00040_Haskell/00130_Calculator-on-Parsec-and-GTK/index.md b/080_blog/00040_Haskell/00130_Calculator-on-Parsec-and-GTK/index.md new file mode 100644 index 0000000..381b017 --- /dev/null +++ b/080_blog/00040_Haskell/00130_Calculator-on-Parsec-and-GTK/index.md @@ -0,0 +1,23 @@ +Simple Calculator on Parsec and GTK +=================================== + + May 3, 2018 + +![](calc.png){.img-fluid .border} + +Today I implemented this simple stupid calulator as a side effect of playing +around with parsec [1] and haskells gtk3 [2] bindings, as well as glade [3] - +an interactive user interface designer. + +Source Files +------------ + +* [calc.hs](calc.hs) +* [calc.glade](calc.glade) + +Ref +--- + + [1] https://hackage.haskell.org/package/parsec + [2] https://hackage.haskell.org/package/gtk3 + [3] https://glade.gnome.org/ diff --git a/080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/index.md b/080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/index.md new file mode 100644 index 0000000..8211ba2 --- /dev/null +++ b/080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/index.md @@ -0,0 +1,31 @@ +A Minimalistic SVG Generator +============================ + + May 11, 2018 + + +A minimalistic SVG generator for my humble requirements. +They might grow someday however... + +The SVG in the following screenshot was generated from the following code +to demonstrate a simple use case. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines} +svgExample1 = svgAddList (svgEmpty (svgShGray 200) 300 200) $ + [ svgRedLine (0,0) (200,200) + ,svgRedLine (300,0) (100,200) + ,svgBluePoint (33,133) + ,svgBluePoint (33,22) + ,svgBluePoint (66,25) + ,svgFilledTriangle svgBlack svgWhite (20,20) (100,100) (10,90) + ,svgFilledCircle svgWhite svgGreen (150,120) 30 + ]++ + map (svgBluePoint . (,) 250) [50,60..150] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +![](svg.png){.img-fluid .border} + +Source Files +------------ + +* [SimpleSvg.hs](SimpleSvg.hs) diff --git a/080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/svg.png b/080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/svg.png new file mode 100644 index 0000000..d679fad Binary files /dev/null and b/080_blog/00040_Haskell/00140_Minimalistic-SVG-Generator/svg.png differ diff --git a/080_blog/00040_Haskell/00150_Applicative-vs-Monadic-Parsing/index.md b/080_blog/00040_Haskell/00150_Applicative-vs-Monadic-Parsing/index.md new file mode 100644 index 0000000..f9b3a4e --- /dev/null +++ b/080_blog/00040_Haskell/00150_Applicative-vs-Monadic-Parsing/index.md @@ -0,0 +1 @@ +Coming sooner... or later. diff --git a/080_blog/00040_Haskell/00200_Estatico-Page-Maker/index.md b/080_blog/00040_Haskell/00200_Estatico-Page-Maker/index.md new file mode 100644 index 0000000..63f9816 --- /dev/null +++ b/080_blog/00040_Haskell/00200_Estatico-Page-Maker/index.md @@ -0,0 +1,55 @@ +# estático - static website generator + + April 12, 2018 + +Two weeks ago I decided to switch my website from a well known PHP +driven CMS solution, to a light and static set of HTML pages. + +And so I wrote a simple static website generator in +**Haskell**. Of course I know that there are already hundreds out there, +but I wanted my own masturbatory solution. + +I use **pandoc** et al. for most of the work anyway. + +## Features + +* **No** Database +* Input with Simple **Markdown** Files +* Generates **Static HTML** Content +* Embedding data **fetched** via **http/https** +* Embedding self-hosted **asciinema** casts +* Embedding Latex formulas via **MathJx** +* Image Scaling with **ImageMagick** +* Syntax **Highlighting** + +## Try It +You can find the most recent version following the links below. +Build it with _stack_ or use the docker images. + +* +* +* + +## Example Usage +__NOTE: make sure DIR\_OUT exists and is a free directory__ + +You can use the example websites inside the examples/ directory for a start. + +Inside the input directory (e.g. ./examples/example01/) run something along this lines: + + DIR_IN=`pwd` + DIR_OUT=/mnt/yourwebsiteroot + HTML_ROOT=https://www.example.com + SUDO=sudo + IMAGE=migueldirty/estatico + ${SUDO} docker run --rm -v${DIR_IN}:/in:ro -v${DIR_OUT}:/out:rw ${IMAGE} /in /out ${HTML_ROOT} + +Or if you want to test it locally use some local DIR\_OUT and HTML\_ROOT instead: + + DIR_OUT=/home/miguel/testpage + HTML_ROOT=/home/miguel/testpage + +The only real life example I know of, is this very page: _idziorek.net_ +You can find it's sources here: + +* diff --git a/080_blog/00040_Haskell/index.md b/080_blog/00040_Haskell/index.md new file mode 100644 index 0000000..2c02a65 --- /dev/null +++ b/080_blog/00040_Haskell/index.md @@ -0,0 +1,8 @@ +Haskell +======= + +Originally coming from structured and object-oriented programming, I fell +in love with Haskell a couple of years ago. I appreciate it's purity +and laziness and the powerful, static type system. + +You can find here my notes and tiny toy projects related to Haskell. -- cgit v1.2.3