Skip to content

Instantly share code, notes, and snippets.

@Mathnerd314
Mathnerd314 / noto-fonts.nix
Created May 7, 2022 18:46
Discord noto font test
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "noto-fonts";
meta = {
maintainers = with lib.maintainers; [ nickcao midchildan ];
};
nodes.machine = {
imports = [ ./common/user-account.nix ./common/x11.nix ];
environment.systemPackages = [ pkgs.discord ];
environment.variables."XAUTHORITY" = "/home/alice/.Xauthority";
@Mathnerd314
Mathnerd314 / Sequent.hs
Created May 15, 2020 16:31
(A subset of) the two-sided linear logic sequent calculus
delete :: (Eq a) => a -> [a] -> [a]
delete _ [] = error "delete: element not present"
delete x (y:ys) = if x == y then ys else y : delete x ys
data Atom
= Var String
| Constant String
deriving (Eq,Ord,Show)
data Exp
### Keybase proof
I hereby claim:
* I am mathnerd314 on github.
* I am logicus (https://keybase.io/logicus) on keybase.
* I have a public key ASAaMyvHWKOWdOeHKVJlbuwWh5WLWJb6bi42zekcE0MuQQo
To claim this, I am signing this object:
@Mathnerd314
Mathnerd314 / theme.css
Created December 25, 2019 21:53
BetterDiscord Custom CSS to hide repeated usernames in the compact theme
.da-messageCompact:nth-child(n+2) .da-username {
visibility: hidden;
}
.da-headerCompact {
display: table-cell;
width: 1px;
height: 1px;
padding-right: .3rem;
vertical-align: top;
}
@Mathnerd314
Mathnerd314 / Miniadapton.hs
Last active October 26, 2016 23:28
Mini adapton in Haskell
{-# LANGUAGE RecordWildCards, FlexibleContexts, ScopedTypeVariables, FlexibleInstances, OverlappingInstances, GADTs, StandaloneDeriving #-}
import Data.Set as Set
import Data.IORef
import Data.Maybe
import Data.Dynamic hiding (cast)
import Data.Function(on)
import Control.Applicative
import Control.Monad.Fix
import System.IO.Unsafe
Derive
((("out"
,"/nix/store/m821yarrwal6g1yjf64awc3ahnbg62dp-nixos-14.04.350.a8f6601"
,""
,""))
,(("/nix/store/2zzsrd0idk3vqsgl6sia3rl894fbadph-modprobe.drv"
,("out"))
,("/nix/store/32dm52z06bw5zn15397r4n2p5sqw9zps-password-file.drv"
,("out"))
,("/nix/store/41d2c4b4fa9sbakxzavb5r6al95jick3-shadow-4.1.5.1.drv"
import Numeric.Probability.Distribution(T,uniform,decons,norm)
import Data.Maybe(fromJust)
step :: T Rational Integer -> T Rational Integer
step x = norm $ do
cash <- x
if (cash == 0) then
return 0
else do
f <- uniform [flip (-) 1, (*3)]
@Mathnerd314
Mathnerd314 / 0-from
Created December 12, 2010 18:06 — forked from vito/0-from
-- | Foo
{ bar :: Baz
-- | Blah
, fizz :: Buzz
-- | Fizzbuzz
, blah :: Etc
}