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
import {AllDiscountsQuery, useAllDiscountsQuery} from '../../generated/graphql'; | |
import * as A from 'fp-ts/Array'; | |
import * as O from 'fp-ts/Option'; | |
import {flow, pipe} from 'fp-ts/function'; | |
import constate from 'constate'; | |
import {ApolloError} from '@apollo/client'; | |
type ProductType = 'variant' | 'product'; | |
type Discount< |
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
import { | |
ApolloLink, | |
ApolloProvider, | |
ApolloClient, | |
InMemoryCache, | |
HttpLink, | |
split, | |
FetchResult, | |
} from '@apollo/client'; | |
import {BatchHttpLink} from '@apollo/client/link/batch-http'; |
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
#! /usr/bin/env nix-shell | |
#! nix-shell -i sh -p hoogle skim | |
sk -i -c "hoogle -q --count=50 '{}'" --preview="hoogle -i '{1..2}'" --cmd-prompt="hoogle> " |
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
#! /usr/bin/env nix-shell | |
#! nix-shell -i sh -p jq fzf | |
OPTION_CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/nixos-options.json" | |
test -f "$OPTION_CACHE" || { | |
echo "Building cache..." | |
cp "$(export NIXPKGS_ALLOW_UNFREE=1; nix-build -Q --no-out-link '<nixpkgs/nixos/release.nix>' -A options)/share/doc/nixos/options.json" "$OPTION_CACHE" | |
} | |
OPTION=$(jq -r 'keys | join("\n")' "$OPTION_CACHE" | fzf --height "60%" --preview 'nixos-option {}') |
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
#! /usr/bin/env nix-shell | |
#! nix-shell -i sh -p jq awk fzf | |
PKG=$(nix search "$1" --json \ | |
| jq -r '. | to_entries | map("\(.key)|\(.value.version)|\(.value.description)") | join("\n")' \ | |
| awk -F "|" '{ printf "\033[34m%-40s \033[32m%-20s \033[0m%s\n", $1, $2, $3 }' \ | |
| fzf \ | |
| awk '{ print $1 }' | |
) |
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 Css | |
( parseName, parseClass | |
) where | |
import Prelude | |
import Control.Alt ((<|>)) | |
import Data.Array as Array | |
import Data.Char.Unicode (toUpper) | |
import Data.List (elem, many) | |
import Data.Maybe (Maybe, fromMaybe, isNothing) |
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
import * as ls from 'fp-ts-local-storage' | |
import { io } from 'fp-ts/lib/IO' | |
import { none } from 'fp-ts/lib/Option' | |
import { fold } from 'fp-ts/lib/boolean' | |
import { constVoid, flow } from 'fp-ts/lib/function' | |
import { curry } from 'ramda' | |
const isBrowser = io.of(typeof localStorage === "undefined"); | |
const foldIo = curry( |
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 Bind.Keys.Windows | |
( windows | |
) | |
where | |
import XMonad.Actions.Promote ( promote ) | |
import Bind.Keys.Internal ( Keymap | |
, subKeys | |
, zipKeys | |
, directionKeys | |
, directions |
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 Bind.Keys.Internal where | |
import XMonad ( XConfig | |
, KeyMask | |
, X | |
, KeySym | |
, mod4Mask | |
, xK_Super_L | |
) | |
import XMonad.Util.NamedActions ( addName |
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
{-# OPTIONS -fno-warn-missing-signatures #-} | |
module Container.Layout | |
( layout | |
) | |
where | |
import XMonad ( (|||) ) | |
import XMonad.Layout ( Full(..) ) | |
import XMonad.Hooks.ManageDocks ( avoidStruts ) |
NewerOlder