Skip to content

Instantly share code, notes, and snippets.

View erthalion's full-sized avatar

Dmitrii Dolgov erthalion

View GitHub Profile
@Kazark
Kazark / CurryHoward.lhs
Last active January 12, 2024 13:21
Curry-Howard Tutorial in Literate Haskell
This is a tutorial on the Curry-Howard correspondence, or the correspondence
between logic and type theory, written by Keith Pinson, who is still a learner
on this subject. If you find an error, please let me know.
This is a Bird-style literate Haskell file. Everything is a comment by default.
Lines of actual code start with `>`. I recommend that you view it in an editor
that understands such things (e.g. Emacs with `haskell-mode`). References will
also be made to Scala, for programmers less familiar with Haskell.
We will need to turn on some language extensions. This is not an essay on good
@tazjin
tazjin / thoughts.md
Last active February 28, 2024 12:05
Nix builder for Kubernetes
@ericbn
ericbn / .vimrc
Last active March 31, 2024 10:39
Vim Powerline-like status line without the need of any plugin
" Statusline (requires Powerline font)
set statusline=
set statusline+=%(%{&buflisted?bufnr('%'):''}\ \ %)
set statusline+=%< " Truncate line here
set statusline+=%f\ " File path, as typed or relative to current directory
set statusline+=%{&modified?'+\ ':''}
set statusline+=%{&readonly?'\ ':''}
set statusline+=%= " Separation point between left and right aligned items
set statusline+=\ %{&filetype!=#''?&filetype:'none'}
set statusline+=%(\ %{(&bomb\|\|&fileencoding!~#'^$\\\|utf-8'?'\ '.&fileencoding.(&bomb?'-bom':''):'')
@akorotkov
akorotkov / pg_graph
Created June 5, 2016 10:21
Draw psql output as iTerm2 v3 inline graph using matplotlib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Draw psql output as iTerm2 v3 inline graph using matplotlib
# Author: Alexander Korotkov <a.korotkov@postgrespro.ru>
import sys
import re
import warnings
import matplotlib
matplotlib.use("Agg")
@kwilczynski
kwilczynski / disable-ipv6.sh
Last active April 11, 2024 11:09
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lmullen
lmullen / Makefile
Last active February 25, 2023 21:14
PDF slides and handouts using Pandoc and Beamer
SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md))
HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md))
all : $(SLIDES) $(HANDOUTS)
%.md.slides.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -o $@
%.md.handout.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -V handout -o $@
@leobm
leobm / gist:6061734
Created July 23, 2013 11:41
break point in clojure - A macro from 《the joy of clojure》 for debugging:
(defn contextual-eval [ctx expr]
(eval
`(let [~@(mapcat (fn [[k v]] [k `'~v]) ctx)]
~expr)))
(defmacro local-context []
(let [symbols (keys &env)]
(zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols)))
(defn readr [prompt exit-code]
(let [input (clojure.main/repl-read prompt exit-code)]
(if (= input ::tl)
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now