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 --pure -i runhaskell | |
#! nix-shell -E "with import (fetchTarball{url=\"https://github.com/NixOS/nixpkgs/archive/d887ac7aee92e8fc54dde9060d60d927afae9d69.tar.gz\";sha256=\"1bpgfv45b1yvrgpwdgc4fm4a6sav198yd41bsrvlmm3jn2wi6qx5\";}) {}; let hs=haskellPackages.ghcWithPackages(p:[p.postgresql-simple p.async p.turtle p.text p.process p.time]); in mkShell{buildInputs=[postgresql hs cacert];}" | |
{- | |
Haskell script that reproduces race condition in PostgreSQL database. | |
This is not considered a bug but rather an expected behavior, | |
just something you should be aware of. | |
This test demonstrates that if you have two transactions and data reads in both |
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
# How to use/test: | |
# nix-build neovim.nix -o neovim | |
# neovim/bin/nvim | |
let | |
nixpkgs-unstable-pin = fetchTarball { | |
url = "https://releases.nixos.org/nixos/unstable/nixos-21.11pre308897.e41ba381140/nixexprs.tar.xz"; | |
sha256 = "1smkm0z569lp321m7jsyy1fvnvl2nc8vh2nak946r9fd4hl4px4p"; | |
}; | |
in |
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 --pure -i runhaskell -E "import ./shell.nix {}" | |
{- | |
This is a demonstration of the fix of the issue | |
https://github.com/haskell-servant/servant/issues/1346 | |
Run server (make sure there’s “shell.nix” in the same directory): | |
./issue-fix-demo.hs |
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 --pure -i runhaskell -E "import ./shell.nix {}" | |
{- | |
This a demonstration of the issue with Servant library. | |
ReqBody' '[Optional] doesn’t make the value be optional, | |
the value of ReqBody isn’t wrapped into Maybe as it supposed to. | |
Run server (make sure there’s “shell.nix” in the same directory): | |
./issue-demo.hs |
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 runhaskell -E | |
#! nix-shell "let ghc=n.haskellPackages.ghcWithPackages(p:[p.hspec]); n=import(fetchTarball{url=\"https://github.com/NixOS/nixpkgs/archive/db31e48c5c8d99dcaf4e5883a96181f6ac4ad6f6.tar.gz\";sha256=\"1j5j7vbnq2i5zyl8498xrf490jca488iw6hylna3lfwji6rlcaqr\";}){}; in n.mkShell{buildInputs=[ghc];}" | |
-- Reimplementation of Haskell’s "Data.Foldable.Foldable" from "Prelude" in order to fix partial | |
-- functions. | |
-- | |
-- Author: Viacheslav Lotsmanov, 2020 | |
-- | |
-- Still WIP, planning to make a library as soon as it implements all the required stuff. |
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
<style> | |
table th, table td { | |
border: 1px solid black; | |
} | |
</style> | |
<table dir="auto"> | |
<tr> | |
<th><b>8.10.1</b></th> | |
<th><b>8.8.3</b></th> |
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 --pure -i runhaskell | |
#! nix-shell -E "with import (fetchTarball { url = \"https://github.com/NixOS/nixpkgs/archive/db31e48c5c8d99dcaf4e5883a96181f6ac4ad6f6.tar.gz\"; sha256 = \"1j5j7vbnq2i5zyl8498xrf490jca488iw6hylna3lfwji6rlcaqr\"; }) {}; mkShell { buildInputs = [(haskellPackages.ghcWithPackages (p: [p.servant p.servant-server]))]; }" | |
{-# LANGUAGE UnicodeSyntax #-} | |
import Servant | |
main ∷ IO () | |
main = putStrLn "foo" |
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 raku | |
use v6.d; | |
# Author: Viacheslav Lotsmanov, 2020 | |
constant report-note = q«Working on some project»; | |
sub report-day(Str \date, Rat \hours) { | |
my Str @cmd = './report', "--date={date}", 'hours', hours.fmt(q/%0.1f/), report-note; | |
my Str @logcmd = @cmd.map({ .match(/\s/) ?? "'$_'" !! $_ }); | |
"[{@cmd.elems}] {@logcmd.join: ' '}".note; |
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
{ | |
nixpkgs ? import <nixpkgs> {}, | |
name, | |
tag, | |
}: | |
let | |
inherit (nixpkgs) pkgs; | |
inherit (pkgs) dockerTools; | |
in |
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
/*! | |
* Date: December 2019 | |
* Author: Viacheslav Lotsmanov | |
* License: Public Domain | |
* | |
* Special thanks to Gerrit Birkeland @gitter_gerrit0:matrix.org | |
* from https://riot.im/app/#/room/#typescript:matrix.org | |
* for good working examples and explanation! | |
* | |
* This module provides "deNull" which tries to |
NewerOlder