Skip to content

Instantly share code, notes, and snippets.

View 3noch's full-sized avatar
🕯️

Elliot Cameron 3noch

🕯️
  • Indiana
View GitHub Profile
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.boot.initrd.iscsi;
fileSystems = attrValues config.fileSystems ++ config.swapDevices;
iscsiDevs = filter (dev: dev.iscsi.enable) fileSystems;
anyiscsi = fold (j: v: v || j.iscsi.enable) false iscsiDevs;
iscsiOptions = {
@glogiotatidis
glogiotatidis / remove-gpg-user.sh
Created May 24, 2016 11:50
Git-crypt remove user.
#!/bin/bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
@Icelandjack
Icelandjack / Constraints.org
Last active April 2, 2024 20:22
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.

{ ... }:
{
imports = [ <nixpkgs/nixos/modules/virtualisation/virtualbox-image.nix> ];
environment.systemPackages = [ pkgs.hello ];
}
[nix-shell:~/rpi/linux]$ make bcm2709_defconfig
[nix-shell:~/rpi/linux]$ make gconfig
[nix-shell:~/rpi/linux]$ time make CROSS_COMPILE=arm-none-eabi- -j 8
@domenkozar
domenkozar / nixos-on-dell-9560.org
Last active August 25, 2023 17:07 — forked from grahamc/nixos-on-dell-9560.org
NixOS on a Dell 15" 9560 with the 4K screen.
@treeowl
treeowl / BasicNat.hs
Last active December 13, 2023 15:12
Fast total sorting of arbitrary Traversable containers
{-# LANGUAGE DataKinds, TypeFamilies, TypeOperators, GADTs,
ScopedTypeVariables, TypeOperators #-}
-- | Type-level natural numbers and singletons, with proofs of
-- a few basic properties.
module BasicNat (
-- | Type-level natural numbers
Nat (..)
, type (+)
@chrisdone
chrisdone / Parsing.md
Last active February 9, 2022 11:50
Good parser messages with Parsec

Intro

I've been working on a parser for a Haskell-like syntax called Duet. In the implementation I've taken particular care to make an awesome tokenizer and parser that is super helpful to learners.

Jasper Van der Jeugt made a talk about producing good error messages recently, which coincides nicely with my parallel work on this. So I thought I'd also share my

Copyright 2017 Austin Seipp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
@chshersh
chshersh / ghci.conf
Last active December 5, 2023 00:19
Config for GHCi with pretty output
-- To run:
-- cabal repl -b pretty-simple
--
-- Colorizing and pretty-printing ghci output
-- requires: pretty-simple
:set -interactive-print=Text.Pretty.Simple.pPrint
-- green bold lambdas and multiline mode
:set prompt "\ESC[1;32mλ: \ESC[m"
:set prompt-cont "\ESC[1;32mλ| \ESC[m"