Skip to content

Instantly share code, notes, and snippets.

@mkohlhaas
mkohlhaas / Installation Gleam on Archlinux
Last active November 25, 2024 20:54
Installation Gleam on Archlinux
Location Gleam package: https://aur.archlinux.org/packages/gleam
Download snapshot: wget https://aur.archlinux.org/cgit/aur.git/snapshot/gleam.tar.gz
Extract: tar xvzf gleam.tar.gz && cd gleam
Build package but ignore dependencies as we are using Kerl: makepkg -d
Install: sudo pacman -Udd *.zst
@mkohlhaas
mkohlhaas / installation kerl rebar3
Last active October 20, 2024 20:31
kerl, rebar3
$ sudo pacman -S unixodbc
$ sudo pacman -S jdk-openjdk
$ sudo pacman -S wxwidgets-gtk3
$ sudo pacman -S fop
export KERL_DOC_TARGETS="html chunks"
export KERL_BUILD_DOCS=yes
export KERL_BUILD_BACKEND=tarball
export KERL_CONFIGURE_OPTIONS="--without-odbc"
@mkohlhaas
mkohlhaas / mappings.lua
Created September 26, 2024 21:04
Mappings AstroNvim
-- ~/.config/nvim/lua/plugins/mappings.lua
return {
{
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
mappings = {
n = {
["j"] = { "jzz" },
["k"] = { "kzz" },
@mkohlhaas
mkohlhaas / purescript.lua
Last active September 26, 2024 14:29
PureScript Language Server Settings for AstroNvim
-- ~/.config/nvim/lua/plugins/purescript.lua
return {
{ "purescript-contrib/purescript-vim" },
{ "AstroNvim/astrolsp",
opts = {
config = {
purescriptls = {
settings = {
purescript = {
formatter = "purs-tidy",
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local map = vim.keymap.set
map("n", "j", "jzz")
map("n", "k", "kzz")
map("n", "n", "nzz")
map("n", "N", "Nzz")
# vim:fileencoding=utf-8:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
# font_family monospace
# bold_font auto
# Enable the subsequent settings only in interactive sessions
case $- in
*i*) ;;
*) return ;;
esac
# Path to your oh-my-bash installation.
export OSH='/home/schmidh/.oh-my-bash'
# Set name of the theme to load. Optionally, if you set this to "random"
@mkohlhaas
mkohlhaas / gist:85771d0d3a03ddaccd9d146108edc552
Last active December 1, 2023 18:02
FFI Playground Pharo
index := FFITutorial createIndex: 0 display: 0.
tu := FFITutorial parseTranslationUnit: 'tst.h' index: index
'tst.h' asFileReference absolutePath
'tst.h' asFileReference contents
"struct foo {
int bar;
int *bar_pointer;
};
@mkohlhaas
mkohlhaas / hamlet.txt
Created November 18, 2023 15:34
Word count in Pharo/Smalltalk
splitChars := {Character space . Character lf . $, . $. . $! . $? . $' . $: . $; . $- . $_ . $? . $! . $´}.
rawWords := 'hamlet.txt' asFileReference contents substrings: splitChars.
words := rawWords collect: [:word | word asLowercase trimBoth] thenSelect: [:word | word size > 3 ].
words asBag sortedCounts.
require 'fdb'
FDB.api_version 730
####################################
## Initialization ##
####################################
# Data model:
# ['attends', student, class] = ''