Skip to content

Instantly share code, notes, and snippets.

hmemcpy / testcontainer.scala
Created Jul 8, 2020
ZIO layer for Postgres test container
View testcontainer.scala
import com.dimafeng.testcontainers.PostgreSQLContainer
import zio.blocking.{effectBlocking, Blocking}
import zio.{Has, ZLayer, ZManaged}
object TestContainer {
type Postgres = Has[PostgreSQLContainer]
def postgres(version: Option[String] = None): ZLayer[Blocking, Throwable, Postgres] =
ZManaged.make {
effectBlocking {
title date tags
2020-01-23 04:51:52 -0800

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar neque laoreet suspendisse interdum consectetur libero id. Nec feugiat nisl pretium fusce id velit ut tortor. Faucibus nisl tincidunt eget nullam. Dui id ornare arcu odio ut sem nulla pharetra. Praesent tristique magna sit amet purus gravida quis. Dictum sit amet justo donec enim diam vulputate ut. Velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum. Tortor at risus viverra adipiscing at in tellus. In iaculis nunc sed augue lacus viverra. Mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget. Consequat nisl vel pretium lectus quam. Adipiscing elit pellentesque habitant morbi tristique senectus et netus. Sapien faucibus et molestie ac feugiat sed lectus. Quam adipiscing vitae proin sagittis nisl rhoncus mattis rhoncus urna. Eros donec ac odio tempor orci dapibus ultrices. Tincidunt tor

View shell.nix
{ pkgs ? import <nixpkgs> {} }: with pkgs;
pygments24 = pythonPackages.pygments.overrideAttrs(old: rec {
version = "2.4.2";
src = pythonPackages.fetchPypi {
inherit version;
inherit (old) pname;
sha256 = "15v2sqm5g12bqa0c7wikfh9ck2nl97ayizy1hpqhmws5gqalq748";
hmemcpy / introduction6.groovy
Created Oct 3, 2018 — forked from peysal/introduction6.groovy
introduction to groovy 1) empty map 2) adding things to map 3) concat map to map 4) iterating
View introduction6.groovy
def emptyMap = [:]
assert emptyMap.size() == 0
def notEmptyMap = ["person1":"john", "person2":"mus"]
assert notEmptyMap.size() == 2
notEmptyMap.put "person3","test" //adding to existing one
assert notEmptyMap.size() == 3
notEmptyMap["person4"] = "beth"
assert notEmptyMap.size() == 4
View code-box.tex
\setmonofont[BoldFont={Inconsolata LGC Bold}]{Inconsolata LGC}
# Shrinks the PDF by compressing images to JPEG using highest quality
# Original code from
# Modified with command taken from
shrink ()
echo "Converting $IFILE > $OFILE"
hmemcpy /
Last active Oct 7, 2018
RAMDisk benchmarks
hmemcpy / .gitignore
Created Feb 12, 2016
VS default .gitignore
View .gitignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
# User-specific files (MonoDevelop/Xamarin Studio)
View gist:8e126d7a3b8d25a8755d
let unionCases<'a> =
|> (fun x -> FSharpValue.MakeUnion(x, [||]) :?> 'a)
|> Array.toList
let deck : Deck =
(unionCases<Suit>, unionCases<Rank>) ||> cartesianProduct
You can’t perform that action at this time.