Skip to content

Instantly share code, notes, and snippets.

@Kartones
Kartones / postgres-cheatsheet.md
Last active April 21, 2025 19:51
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@kipcole9
kipcole9 / function_clause.ex
Created October 23, 2019 11:04
Debug Elixir Function Clause errors
defmodule FunctionClause do
@moduledoc """
Format function clauses using Exception.blame/3
"""
@doc """
Given a `module`, `function`, and `args` see
if that function clause would match or not match.
This is useful for helping diagnose function
@tkersey
tkersey / the-alegbra-of-typescript.md
Last active October 17, 2021 06:08
The Algebra of [Type,Script]

Algebra

Symbols Operations Laws
0, 1, 2, x, y, z, ... +, –, x, ÷, ... 0 + x = x, ...

Algebra

Symbols Operations Laws
@jameshaydon
jameshaydon / whynothaskell.md
Last active February 12, 2025 09:21
Why (some) Python programmers don't choose Haskell

Why Python and not Haskell?

This thread asks why more Python developers couldn't instead be using Haskell: https://discourse.haskell.org/t/commercial-haskell-should-go-after-python-julia-not-rust/6964/2

One of the points made in this thread, is that there is a sizeable class of Python programmers for which the trope "Python programmers will be scared of monads!" doesn't apply. I thought I would ask some of the people I know that use Python why they don't use Haskell.

Some notes about the demographic:

  • These people all work as academic researchers in Computer Science, formal methods, ranging from very abstract to quite practical.
  • Two of them know more about Category Theory and monads than the vast majority of Haskellers.