Skip to content

Instantly share code, notes, and snippets.

View svalaskevicius's full-sized avatar

Sarunas Valaskevicius svalaskevicius

View GitHub Profile
import cats.{Eval, Monad}
class StateT[F[_], S, A](val run: S => F[(S, A)]) extends AnyVal
object StateT {
implicit def monad[F[_], S](implicit F: Monad[F]): Monad[StateT[F, S, *]] = new Monad[StateT[F, S, *]] {
def flatMap[A, B](fa: StateT[F, S, A])(f: A => StateT[F, S, B]): StateT[F, S, B] =
new StateT(
s =>
F.flatMap(
#!/usr/bin/env bash
PACKAGE="$1"
VERSION="$(cat "$1.cabal" | grep -e '^version:[0-9 \.]*$' | sed -e 's/^version:\s*\([0-9\.]*\)\s*$/\1/')"
if test -z "$VERSION" ; then
echo "version not found."
exit 1
fi
@svalaskevicius
svalaskevicius / _bdbxml-clang-cpp11.md
Created December 16, 2012 20:57
BDB XML on mac with clang and cpp11

Compiling BDBXML for clang and c++11

To be able to compile BDB XML with clang, there are some code changes to be implemented first - see the accompanying patch file.

patch -p2 < ~/bdbxml-clang.patch

./buildall.sh -m 'make -j6' \
--with-configure-env="CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -lc++ -mmacosx-version-min=10.7 -Wno-c++11-narrowing' LDFLAGS='-stdlib=libc++ -lc++ -mmacosx-version-min=10.7'" \
@svalaskevicius
svalaskevicius / _proftpd_for_sftp.md
Created December 15, 2012 15:12
a guide to install sftp with proftpd

Setting up

The following commands assume the system is CentOS/RedHat Linux and ProFTPD configuration is same or similar to CentOS package version: 1.3.3g; release: 1.el6.

yum install proftpd

cd ~/
wget https://gist.github.com/raw/4296200/proftpd.conf.patch
#!/bin/bash
set -e
if [[ $1 == "-v" ]]; then
verbose=1
shift
fi
process=$1