Skip to content

Instantly share code, notes, and snippets.

Avatar

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
michaellihs / gitlab_access_token.md
Last active May 20, 2020
Create Gitlab Personal Access Token using curl
View gitlab_access_token.md

Create Gitlab Personal Access Token using curl

Prerequisites

  • 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
0sc / aws-go+docker-setup.sh
Last active Sep 10, 2019
Setup script for golang, docker and docker-compose on Amazon Linux AMI 2017.09.0 (HVM) on EC2
View aws-go+docker-setup.sh
#!bin/sh
# Update installed packages and package cache
sudo yum update -y
# make sure in the home folder
cd ~/
# Golang installation
View why-i'm-leaving-kubernetes-for-swarm.md

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 (saharacluster.com).

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
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
```Haskell
Free f a = { unFree :: f (Free f a) }
```
http://softwareengineering.stackexchange.com/questions/242795/what-is-the-free-monad-interpreter-pattern
# construction of free monad via individual functions
http://www.atamo.com/articles/free-monads-wont-detox-your-colon/
@CMCDragonkai
CMCDragonkai / nix_string_and_path_concatenation.md
Last active Sep 23, 2020
Nix: String and Path Concatenation #nix #nixos
View nix_string_and_path_concatenation.md

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
karloku / README.md
Last active Mar 30, 2018
Rails Template using GraphQL
View README.md

This template is supposed to be applied to rails 5.

run with:

rails new <application_name> --template=https://gist.githubusercontent.com/karloku/edd6a158e275fdefa334/raw/b56175bee5b45d32310aeb620e23be44e3c2a56d/graphql_template.rb -T

using gems:

  • graphql
  • graphql-mutable_type
View nix-ui.md

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. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz 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
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 = SignedCookieGenerator.new(:auth, user.id)
page.driver.browser.set_cookie(cookie.to_s)
You can’t perform that action at this time.