Skip to content

Instantly share code, notes, and snippets.

View taktoa's full-sized avatar
🤔
Confused about why this feature exists

Remy Goldschmidt taktoa

🤔
Confused about why this feature exists
View GitHub Profile

Things to keep in mind

  • If you write a server using raw UDP, the size of a packet returned as a result of a packet received must be strictly smaller than the size of the packet received, to prevent DoS amplification attacks.
@taktoa
taktoa / haskell-pain-points.md
Last active October 26, 2019 04:18
A rant about pain points in Haskell, written as a response to https://redd.it/7rwuxb

I started writing this polemic to answer your question, but I ended up touching on most of my gripes with Haskell in general, not just in a corporate context.

GHC

GHC is a modern compiler with an amazing RTS and tons of features, but I have some issues with it.

Monolithic and Hard to Contribute To

--------------------------------------------------------------------------------
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
@taktoa
taktoa / KindOfGenerativeModuleFunctors.agda
Created November 27, 2017 17:21
A quasi-successful attempt at hacking generative module functors into Agda 2.5.3
module KindOfGenerativeModuleFunctors where
------------------------------------------------------------------------------
open import Data.Product using (_×_; _,_)
open import Data.Nat using (ℕ)
open import Data.Bool using (Bool; false; true)
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
------------------------------------------------------------------------------
@taktoa
taktoa / keybase.nix
Created November 22, 2017 20:21
Getting the Keybase GUI to work on NixOS
# Add this file to your /etc/nixos/configuration.nix `imports = [ ... ];` attribute.
#
# After running `nixos-rebuild switch`, `systemctl --user start keybase-gui.service`
# can be used to start the Keybase GUI.
#
# Not sure if it's just my tiling window manager, but there is a bit of wonkiness
# with the tray icon. Other than that it works perfectly (as of 2017/11/22).
{ pkgs, ... }:
@taktoa
taktoa / .hlint.yaml
Created November 19, 2017 04:07
My HLint YAML file
- extensions:
- default: true
# These are basically non-negotiable
- {name: AllowAmbiguousTypes, within: []} # should never be necessary
- {name: Arrows, within: []} # weird syntax
- {name: DatatypeContexts, within: []} # useless
- {name: EmptyCase, within: []} # nearly useless
- {name: ImpredicativeTypes, within: []} # very buggy
- {name: IncoherentInstances, within: []} # footgun
@taktoa
taktoa / collapse.tex
Created November 10, 2017 16:51
Collapseable text box in LaTeX using OCG
% in the preamble:
\usepackage{ocgx}
% in the document:
\switchocg{ocgPlus ocgMinus ocg1}{%
\begin{ocg}{plus}{ocgPlus}{1}
{\bfseries +}
\end{ocg}
@taktoa
taktoa / mrkgnaow-xmonad.nix
Created September 25, 2017 15:30
Example of using `callCabal2nix` to set up xmonad with a cabalized configuration
{ pkgs }:
{
services.windowManager.xmonad = {
enable = true;
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: {
# /path/to/mrkgnaow-xmonad is a path that contains `mrkgnaow-xmonad.cabal`
# you can also put an invocation of `fetchgit` or `fetchFromGitHub` there.
mrkgnaow-xmonad = self.callCabal2nix "mrkgnaow-xmonad" /path/to/mrkgnaow-xmonad {};
@taktoa
taktoa / Badges.hs
Created September 22, 2017 09:13
Hydra badge server, written in Haskell
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Main where
import Numeric (showHex)