- 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE KindSignatures #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, ... }: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% in the preamble: | |
\usepackage{ocgx} | |
% in the document: | |
\switchocg{ocgPlus ocgMinus ocg1}{% | |
\begin{ocg}{plus}{ocgPlus}{1} | |
{\bfseries +} | |
\end{ocg} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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 {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE PackageImports #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeApplications #-} | |
module Main where | |
import Numeric (showHex) |