Skip to content

Instantly share code, notes, and snippets.

@YoEight
YoEight / improve_fonts.md
Created January 15, 2021 10:11 — forked from j1cs/improve_fonts.md
Improve fonts archlinux

Improve Fonts

Newest

Make your Arch fonts beautiful easily! This is what I do when I install Arch Linux to improve the fonts.

You may consider the following settings to improve your fonts for system-wide usage without installing a patched font library packages (eg. Infinality):

Install some fonts, for example:
sudo pacman -S ttf-dejavu ttf-liberation noto-fonts

@YoEight
YoEight / delete.hs
Created February 16, 2020 10:21
How delete for Map should be.
import Data.Map (Map)
import Data.Map as Map
--------------------------------------------------------------------------------
-- | I'm bad at naming thing however, we are going to use that datastructure
-- so we could lookup and delete in one single pass.
data Blob a b = Blob a b
--------------------------------------------------------------------------------
instance Functor (Blob a) where
@YoEight
YoEight / Main.hs
Last active September 27, 2019 06:32
eventstore client showdown
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NumericUnderscores #-}
module Main where
import Control.Monad
import Database.EventStore
import qualified Data.Text as Text
import Data.Aeson
#!/usr/bin/env stack
-- stack --resolver lts-13.27 script --package text --package turtle --package async
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent.Async
import Data.Foldable
import Data.Text (pack)
import Turtle
@YoEight
YoEight / Play.hs
Created April 19, 2019 08:51
Implementing `machines` using `streaming` library
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
module Play where
import Prelude hiding ((.), id)
import Data.Foldable
import Streaming.Internal
import Control.Category
infixr 9 <~
@YoEight
YoEight / docker-cleanup-resources.md
Created August 3, 2018 20:23 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@YoEight
YoEight / extensible.hs
Created April 27, 2018 16:06
POC of eventsource-api using an extensible-effects interface
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE UndecidableInstances #-}
module Main where
@YoEight
YoEight / stopwatch.hs
Created June 7, 2017 20:36
Simple threadsafe stopwatch
--------------------------------------------------------------------------------
-- |
-- Module : Database.EventStore.Internal.Stopwatch
-- Copyright : (C) 2017 Yorick Laupa
-- License : (see the file LICENSE)
--
-- Maintainer : Yorick Laupa <yo.eight@gmail.com>
-- Stability : provisional
-- Portability : non-portable
--
@YoEight
YoEight / graph.hs
Created June 19, 2016 15:07
Stream based Graph processing example in Haskell
module Graph where
import qualified Data.Map as M
import qualified Data.Set as S
data Vertex v =
Vertex
{ vertexId :: Int
, vertexValue :: v
}