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 | |
_find_latest_package_version() { | |
_url="https://hackage.haskell.org/package/${1}" | |
curl -sH "Accept: application/json" "${_url}" | | |
jq -r ". | (keys[] | [.]) | @csv" | | |
sed "s/\"//g" | | |
sort -t. -k1,1n -k2,2n -k3,3n -k4,4n | | |
tail -n1 |
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
{ lib | |
, fetchFromGitHub | |
, rustPlatform | |
, pkg-config | |
, openssl | |
, stdenv | |
}: | |
rustPlatform.buildRustPackage rec { | |
pname = "oidc-cli"; |
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 | |
_package="${1}" | |
_version="${2}" | |
niv add "${_package}" \ | |
--version "${_version}" \ | |
--template "https://hackage.haskell.org/package/${_package}-<version>/${_package}-<version>.tar.gz" |
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
## Usage: | |
## | |
## 1. Add this script next to `book.toml` under file name `mdbook_plugin_gitinfo.py` | |
## 2. Update `book.toml`: | |
## | |
## ```toml | |
## [preprocessor.gitinfo] | |
## command = "python3 mdbook_plugin_gitinfo.py" | |
## renderers = ["html"] | |
## ``` |
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
-- | Working with closed intervals. | |
-- | |
-- See https://gist.github.com/vst/65ac335e452068ac0306dac61eceb13f | |
-- | |
-- Alternative: https://hackage.haskell.org/package/intervals | |
{-# LANGUAGE FlexibleContexts #-} | |
import Control.Monad.Except (MonadError(throwError)) |
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
-- | See https://gist.github.com/vst/a1a49e0047c8fd24adbd1759bd14f864 | |
-- | |
import Data.Bool (bool) | |
-- | Monadic version of @if-then-else@. | |
-- | |
-- >>> ifM (pure False) (pure "Nice") (pure "Oh no!") | |
-- "Oh no!" | |
-- >>> ifM (pure True) (pure "Nice") (pure "Oh no!") |
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 sh | |
## URL for the latest release: | |
_latest="https://api.github.com/repos/hadolint/hadolint/releases/latest" | |
## Kernel name: | |
_kernel="$(uname -s)" | |
## Architecture: | |
_arch="$(uname -m)" |
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 DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Main where | |
import Data.Char (isUpper, toLower) |
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 script | |
--resolver lts-16.0 | |
--package bytestring | |
--package email-validate | |
--ghc-options -Wall | |
--install-ghc | |
--compile | |
-} | |
-- * Command Line Usage: |
NewerOlder