Skip to content

Instantly share code, notes, and snippets.

x ← ⊜□ ≠@\n.&fras "aoc_inputs/day1"
# remove all the non-numeric characters
# take first and last
# parse to number
# sum them all
# DayOnePartOne ← /+∵(⋕⊂⊃⊢(⊢⇌)▽<@a.°□)
# DayOnePartOne x
Wrd ← {"one" "two" "three" "four" "five" "six" "seven" "eight" "nine"}
@mankyKitty
mankyKitty / picosystem-rs-env.nix
Created February 26, 2022 11:29
nix shell for building picosystem-rs things (https://github.com/rlane/picosystem-rs)
{ srcs ? import ./nix/sources.nix }:
let
pkgs = import srcs.nixpkgs {
crossSystem = (import "${srcs.nixpkgs}/lib").systems.examples.raspberryPi // {
rustc.config = "thumbv6m-none-eabi";
};
};
in
pkgs.mkShell {
@mankyKitty
mankyKitty / keybase.md
Created October 20, 2020 09:36
keybase.md

Keybase proof

I hereby claim:

  • I am mankykitty on github.
  • I am mankykitty (https://keybase.io/mankykitty) on keybase.
  • I have a public key ASDlqloTvjxMh_TqV6vXnG9Sw6gZKXsLCUm-S6Sb6AOCqgo

To claim this, I am signing this object:

@mankyKitty
mankyKitty / spiders.hs
Created February 18, 2020 15:30
Property test a reflex FRP function
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Main where
import Debug.Trace
import Control.Monad.IO.Class (liftIO, MonadIO)
import Control.Lens hiding ((|>))
import Control.Monad.State (execStateT, modify)
import Control.Monad
@mankyKitty
mankyKitty / new_hotness.hs
Created February 10, 2020 09:38
Tobasco In Your Coffee Machine Testing Properties.
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE TemplateHaskell #-}
module CoffeeMachineTestsNew where
import Control.Lens
import Control.Monad.State (MonadState, execStateT)
import Control.Monad.IO.Class (MonadIO)
import Data.Foldable (for_)
@mankyKitty
mankyKitty / bem.hs
Last active October 25, 2019 12:24
Type level BEM declarations because why not....
data CSS_BEM (block :: Symbol) = CSS_BEM
{ cssBEMBlock :: Text
, cssBEMElem :: Text -> Text
, cssBEMMod :: Text -> Text
, cssBEMElemMod :: Text -> Text -> Text
}
mkCSSBEM :: forall t. KnownSymbol t => CSS_BEM t
mkCSSBEM = CSS_BEM @t tb (mappend tb__) (mappend (tb <> "--")) (\e m -> tb__ <> e <> "--" <> m)
where
@mankyKitty
mankyKitty / miniadapton.scm
Created October 7, 2019 04:52
weeeeeeeeeeeeeeeeeeeee
;; The mini-set implementation
(define empty-set '())
(define (set-mem e s)
(memv e s))
(define (set-cons e s)
(if (set-mem e s) s (cons e s)))
(define (set-rem e s)
(filter (lambda (x) (not (eqv? e x))) s))
(define (set-union s1 s2)
(fold-left set-cons s2 s1))
@mankyKitty
mankyKitty / welp.hs
Last active September 18, 2019 06:03
weeeee
class MkTuple (xs :: [(a, Type)]) where
type AsTuple xs :: *
mkTuple :: NP P xs -> AsTuple xs
instance MkTuple '[] where
type AsTuple '[] = ()
mkTuple _ = ()
instance MkTuple xss => MkTuple (x ': xss) where
type AsTuple (x : xss) = (Snd x, AsTuple xss)
import qualified Data.Map as M
import Data.Monoid ((<>))
import qualified Graphics.X11.Types as XT
import XMonad (Full (..), Layout,
ManageHook, Mirror (..),
Tall (..), X, XConfig (..),
def, spawn, windows,
xmonad, (.|.), (|||))
import XMonad.Actions.SpawnOn (manageSpawn, spawnOn)