Skip to content

Instantly share code, notes, and snippets.


Serhii Khoma srghma

View GitHub Profile
View purescript-unicode.vim
" turn all symbols into unicode or back
autocmd FileType purescript map <buffer> <silent> <leader>hu :%s/ => //ge<CR>:%s/ -> / → /ge<CR>:%s/ <- //ge<CR>:%s/ :: / ∷ /ge<CR>:%s/ <= //ge<CR>:%s/ forall / ∀ /ge<CR>
autocmd FileType purescript map <buffer> <silent> <leader>hU :%s/⇒/=>/ge<CR>:%s//->/ge<CR>:%s/←/<-/ge<CR>:%s/∷/::/ge<CR>:%s//<=/ge<CR>:%s/∀/forall/ge<CR>
" convert symbols while typing
autocmd FileType purescript iab forall ∀
autocmd FileType purescript iab -> →
autocmd FileType purescript iab <-
View Yoneda.markdown
import Data.Functor.Yoneda
import Data.Char
import Data.Kind

infixr 5

type  List :: (Type -> Type) -> Constraint
class List f where
michaellihs /
Last active May 20, 2020
Create Gitlab Personal Access Token using curl

Create Gitlab Personal Access Token using curl


  • You need a Gitlab server up and running
  • You need user credentials for a (admin) user on the Gitlab server
  • You need curl and Perl on your server
0sc /
Last active Sep 10, 2019
Setup script for golang, docker and docker-compose on Amazon Linux AMI 2017.09.0 (HVM) on EC2
# Update installed packages and package cache
sudo yum update -y
# make sure in the home folder
cd ~/
# Golang installation
View why-i'

I have been an aggressive Kubernetes evangelist over the last few years. It has been the hammer with which I have approached almost all my deployments, and the one tool I have mentioned (shoved down clients throats) in almost all my foremost communications with clients, and it was my go to choice when I was mocking my first startup (

A few weeks ago Docker 1.13 was released and I was tasked with replicating a client's Kubernetes deployment on Swarm, more specifically testing running compose on Swarm.

And it was a dream!

All our apps were already dockerised and all I had to do was make a few modificatons to an existing compose file that I had used for testing before prior said deployment on Kubernetes.

And, with the ease with which I was able to expose our endpoints, manage volumes, handle networking, deploy and tear down the setup. I in all honesty see no reason to not use Swarm. No mission-critical feature, or incredibly convenient really nice to have feature in Kubernetes that I'm go

adamwespiser / free-mtl-notes
Last active Feb 4, 2018
A comparison of performance between Free Monad and mtl transformers
View free-mtl-notes
Objective: A comparison of performance between Free Monad and mtl transformers
Free f a = { unFree :: f (Free f a) }
# construction of free monad via individual functions
CMCDragonkai /
Last active Sep 23, 2020
Nix: String and Path Concatenation #nix #nixos

Nix String and Path Concatenation

From Bas van Dijk:

To understand these things I would recommend using nix-repl:

$ nix-repl
Welcome to Nix version 1.11.2. Type :? for help.
karloku /
Last active Mar 30, 2018
Rails Template using GraphQL

This template is supposed to be applied to rails 5.

run with:

rails new <application_name> --template= -T

using gems:

  • graphql
  • graphql-mutable_type

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

    TBD: How to deal with search path clashes.

terenceponce / profile_management_spec.rb
Last active Jul 13, 2020
Creating Signed Cookies in Capybara
View profile_management_spec.rb
# spec/features/profile_management_spec.rb
require 'rails_helper'
feature 'Profile Management', type: :feature do
given!(:user) { create(:user) }
scenario 'User updates profile' do
cookie =,
You can’t perform that action at this time.