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 { UnionToIntersection, DeepWritable } from 'ts-essentials'; | |
import { State as RouteState } from 'router5'; | |
import { Switch, createState, createEffect, createMemo } from 'solid-js'; | |
import useRoute, { MatchRoute } from './context'; | |
import { Routes } from './definition'; | |
export type RenderTreeOf<Tree> = | |
Owned<Tree> | RenderNode & | |
UnionToIntersection< | |
Tree extends readonly (infer Node)[] |
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 bash | |
INPUT="$(cat)" | |
IFS='' | |
ERRORS="$(mktemp)" | |
EXIT_OK=true | |
if ! (echo "$INPUT" | stylish-haskell 2>>"$ERRORS") ; then |
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 bash | |
CURDIR="$PWD" | |
findconfig() { | |
# via https://unix.stackexchange.com/questions/293393/find-a-specific-file-in-the-nearest-ancestor-of-the-current-working-directory | |
# from: https://www.npmjs.com/package/find-config#algorithm | |
# 1. If X/file.ext exists and is a regular file, return it. STOP | |
# 2. If X has a parent directory, change X to parent. GO TO 1 | |
# 3. Return NULL. |
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 fish | |
# source this within config.fish | |
# set -l NIX_SH ~/.nix-profile/etc/profile.d/nix-daemon.sh | |
set -l NIX_SH ~/.nix-profile/etc/profile.d/nix.sh | |
# get all the vars exported by the script | |
set -l VARS (cat $NIX_SH | grep '^ *export' | sed 's/^ *export *//g' | cut -d= -f1 | sort | uniq) | |
set -l VARS_REGEX '^('(echo $VARS | tr ' ' '|')')$' |
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
/* | |
* Unholy script of helping to rename images exported from LibreOffice Calc. | |
* | |
* instructions: | |
* 1. open sheet in libreoffice calc | |
* 2. ensure all images entirely fit *within* the boundaries of their row | |
* 3. export as html | |
* 4. inject this script to the end of the html <body> | |
* 5. open html file in browser of choice | |
* 6. save script when prompted to same directory as html file |
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
/* @flow */ | |
export type ParseError = { | |
expected: string, | |
got: mixed, | |
at?: mixed, | |
children?: ParseError[], | |
}; | |
export type Result<T> = |
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
{- stack runghc | |
--package servant-server | |
--package servant-js | |
--package servant | |
--package text | |
--package mtl | |
--package lens | |
--package esqueleto | |
--package persistent | |
--package persistent-template |
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
[1 of 1] Compiling Main ( test.hs, test.o ) | |
==================== Simplified expression ==================== | |
quoteExp stmt (unpackCString# "SELECT 123"#) | |
==================== Tidy Core ==================== | |
Result size of Tidy Core | |
= {terms: 663, types: 1,112, coercions: 349} | |
$fSelectorAsdf4 :: [Char] |
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
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE Rank2Types #-} |
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
{-# LANGUAGE OverloadedStrings #-} | |
import Blaze.ByteString.Builder | |
import Control.Lens | |
import Control.Monad.Trans.Either | |
import qualified Data.ByteString as B | |
import Data.Map.Syntax | |
import Heist | |
import Heist.Compiled | |
main = do |
NewerOlder