Skip to content

Instantly share code, notes, and snippets.

View WJWH's full-sized avatar

Wander Hillen WJWH

View GitHub Profile
@WJWH
WJWH / gist:f3a196e65fdabd6eace5f89da430600e
Created October 1, 2021 14:16
Server that does no syscalls for handling connections
// Extremely hacky server program that will send a standard response
// to every client that connects, then closes the connection. Will
// issue no system calls (as measured by `strace`) after initial setup
// no matter how many requests are served.
// Yes, this program is sorely lacking in error checking. It's a toy
// and not meant to be taken seriously.
// compile with gcc no_syscall_server.c -luring
@WJWH
WJWH / Main.hs
Last active April 18, 2022 19:30
Files accompanying blog post on wjwh.eu
{-# LANGUAGE OverloadedStrings, DeriveGeneric, DerivingStrategies, DeriveAnyClass #-}
module Main where
import Prelude hiding (foldl)
import Conduit hiding (connect)
import Data.Attoparsec.ByteString as Attoparsec
import Data.Attoparsec.ByteString.Char8
import qualified Data.ByteString as B
import Data.Aeson
import Data.Conduit.Attoparsec
@WJWH
WJWH / day15.hs
Created December 15, 2022 17:11
Haskell solution progression for AOC 2022 day 15 part 2
module Main where
import Utils
import Control.Concurrent
import Control.Concurrent.Chan
import Data.List
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import Data.Range as Range