Skip to content

Instantly share code, notes, and snippets.

View lincore81's full-sized avatar

lincore81

  • Berlin
View GitHub Profile
@lincore81
lincore81 / postgres-dev-arch-linux-podman.md
Last active January 27, 2025 08:24
Setting up a local dev postgres setup with podman/docker

PostgreSQL dev setup on Arch Linux using podman

Introduction

This document summarises my learnings from setting up a postgres container on arch linux for dev - no prod. I will also touch on using psql and vim-dadbod-ui to interface with the DB. There's also dbeaver, which is the shotgun epquivalent of DB tools (= fire and forget, easy to use), which I won't cover here for that reason. My goal was specifically to set up a local dev env with the limited knowledge I have of docker containers and DBMS in general.

Installing PostgreSQL

I did not want to install postgres on my system directly, although I could run it on demand and kill when done, it seemed cleaner to have a layer of separation. Instead I only installed postgresql-libs (aka libpq) solely for psql, which is essentially a postgres read-eval-print-loop (REPL).

@lincore81
lincore81 / godot_lazyvim.md
Last active February 13, 2025 00:41
Godot + Lazyvim

How to set up LazyVim/Neovim for Godot on Linux

Please note: This setup if for gdscript, not csharp.

External Editor Setup

When clicking on a button or error message that opens a gdscript file in Godot, we want it to open in nvim instead. There are many ways to do this, this is mine:

  • Create a bash script nvim-broadcast with this content:
@lincore81
lincore81 / mount.ts
Last active April 27, 2021 10:54
My clumsy method of injecting HTML into an existing web app
/* USAGE EXAMPLE:
const mountElem1 = document.body;
const nodes = htmlWindowContent(
{ fontSizes
, defaultFontSize
});
const elems = mount(nodes, mountElem);
function htmlWindowContent({fontSizes, defaultFontSize}) {
return m(DIV, {id: ID_TP_CONTENT},
module Asm2 where
type Reg = Char
data Registers = Registers
{ a :: Int
, b :: Int
, c :: Int
, d :: Int
, ip :: Int
@lincore81
lincore81 / blackjack.hs
Created October 23, 2018 15:57
My first attempt to create a real thing in haskell (wip)
data Suit
= Diamonds
| Hearts
| Clubs
| Spades
deriving (Eq, Ord, Enum, Show)
data Rank = Two | Three | Four | Five | Six | Seven | Eight
| Nine | Ten | Jack | Queen | King | Ace
deriving (Eq, Ord, Enum)
const otherwise = true;
const isNumber = n => typeof n === 'number';
const eq = a => b => a === b;
const fib = match([
eq(0), 1,
eq(1), 1,
x < 0, 0,
// initial: value to call first task with
// tasks: varargs, functions to be called in order
// each task must take a callback function and optionally the result of the previous task
// the task must either call callback (with a result) or throw an error.
function async(initial, tasks) {
if (arguments.length === 0) throw new Error('argument required');
var chain = Array.from(arguments).slice(1);
var head = -1;
var top = chain.length - 1;