base set up:
options(device = function(...) bitmap(file = "|kitty +kitten icat --stdin yes", ...))
with options (eg. anti-aliasing)
options(device = function(...) bitmap(file = "|kitty +kitten icat --stdin yes", taa = 2, gaa = 2, ...))
{-# LANGUAGE TemplateHaskell #-} | |
module NgxDistributionTest where | |
import NgxExport | |
import Data.ByteString (ByteString) | |
import qualified Data.ByteString.Lazy.Char8 as C8L | |
import Data.Aeson | |
import Data.Maybe |
{ | |
inputs.nixpkgs.url = "github:NixOs/nixpkgs/22.11"; | |
outputs = { self, nixpkgs }: | |
let | |
pkgs = import nixpkgs { system = "x86_64-linux"; }; | |
inherit (pkgs) lib; | |
lines = txt: | |
(builtins.filter (line: line != "") |
matchMaybe :: forall a. TomlBiMap a AnyValue -> Key -> TomlCodec (Maybe a) | |
matchMaybe Toml.BiMap {forward, backward} key = Toml.Codec input output | |
where | |
input :: Toml.TomlEnv (Maybe a) | |
input toml = case HashMap.lookup key (Toml.tomlPairs toml) of | |
Nothing -> pure Nothing | |
Just anyVal -> pure <$> Toml.whenLeftBiMapError key (backward anyVal) pure | |
output :: Maybe a -> Toml.TomlState (Maybe a) |
#/usr/bin/bash | |
set -e | |
USAGE="Usage: $0 repository installables..." | |
if [ "$#" == "0" ]; then # If zero arguments were supplied, | |
echo "Error: no repository or installables provided." | |
echo "$USAGE" # display a help message | |
exit 1 # and return an error. | |
fi |
{ | |
inputs.nix.url = "github:NixOS/nix/2.13.2"; | |
outputs = { self, nixpkgs, nix }: { | |
packages.x86_64-linux.default = | |
nix.packages.x86_64-linux.nix.overrideAttrs (oldAttrs: { | |
separateDebugInfo = false; | |
phases = [ "unpackPhase" "patchPhase" "autoreconfPhase" "configurePhase" "installPhase" ]; | |
outputs = [ "out" ]; |
#!/usr/bin/env bash | |
SESSION_NAME="$USER@$HOST" # or whatever | |
echo "Requesting federation token" | |
TOKEN1=$(aws sts get-federation-token --name "$SESSION_NAME" --policy-arns arn=arn:aws:iam::aws:policy/AdministratorAccess --output json) | |
URL1=$(jq -r '.Credentials | {sessionId:.AccessKeyId,sessionKey:.SecretAccessKey,sessionToken:.SessionToken} | @uri "https://signin.aws.amazon.com/federation?Action=getSigninToken&SessionType=json&Session=\(.)"' <<< "$TOKEN1") |
#!/usr/bin/env -S jq -f -r | |
# | |
# This jq scripts transforms cabal's plan.json file into a series of fact that souffle can interpret. | |
# | |
# Example use | |
# | |
# $ ~/plan-to-datalog.jq <dist-newstyle/cache/plan.json >plan.dl | |
# | |
# Then create a file query.dl | |
# |
#!/usr/bin/env bash | |
# only subvert cabal | |
PARENT_COMMAND=$(ps -o comm= $PPID) | |
if [ "$PARENT_COMMAND" != "cabal" ]; then | |
exec /usr/bin/git "$@" | |
fi | |
echo "$PWD /usr/bin/git $*" >> ~/git-log |
base set up:
options(device = function(...) bitmap(file = "|kitty +kitten icat --stdin yes", ...))
with options (eg. anti-aliasing)
options(device = function(...) bitmap(file = "|kitty +kitten icat --stdin yes", taa = 2, gaa = 2, ...))