Skip to content

Instantly share code, notes, and snippets.

@artman41
artman41 / tree.erl
Created April 24, 2024 01:01
Binary tree example
-module(tree).
-compile({no_auto_import,[{size, 1}]}).
%% API
-export([
new/0, new/1,
insert/2,
search/2,
to_list/1,
@artman41
artman41 / build_erlang_remarkable.sh
Created June 20, 2023 22:56
Compile erlang for Remarkable
#!/bin/bash
# This script assume that:
# * You have installed the toolchain in the default location
# * You are using toolchain 3.1.15 for rm11x
set -x
export CC=clang;
export CXX=clang;
Byte Control Char
0 ^@
1 ^A
2 ^B
3 ^C
4 ^D
5 ^E
6 ^F
7 ^G
sudo useradd -m erlang;
sudo mkdir -p /usr/local/erl_rel;
sudo chown erlang:erlang /usr/local/erl_rel;
sudo chmod g+rw /usr/local/erl_rel;
sudo usermod -aG erlang $USER;
for ver in 18.3 20.3 22.3 24.3 25.0; do
docker run -e USERID=`id -u erlang` -v /usr/local/erl_rel:/usr/local/erl_rel -it erlang:$ver bash -c 'ERL_VER=`cat /usr/local/lib/erlang/releases/*/OTP_VERSION`; find /usr/local/lib/erlang -name erl -type f | xargs sed -i "s|/usr/local/lib/erlang|/usr/local/erl_rel/$ERL_VER|g"; mv /usr/local/lib/erlang /usr/local/erl_rel/$ERL_VER; chown -R $USERID:$USERID /usr/local/erl_rel/$ERL_VER;';
done;
@artman41
artman41 / heirarchy.json
Last active March 15, 2021 14:33
Valheim Workbench Heirarchy
{
"name": "piece_workbench",
"behaviours": [
{
"name": "ZNetView"
},
{
"name": "Piece"
},
{
@artman41
artman41 / README.md
Last active November 24, 2020 22:15
A logging object for Lua

An example of usage is the following

local Logger = require("objects/logger")

logger = Logger:new(Logger.ERROR())

logger:debug("%s %d", "this is a debug", 1)

logger:error("%s %d", "this is an error", 2)
@artman41
artman41 / wsl-install_another_distro.md
Last active January 25, 2024 23:45
Instructions on how to install a custom distro in WSL2 (Windows SubSystem for Linux 2)

WSL install another distro

  1. Here are some default vars for the process
ISO_DIR=~/fedora;
ROOTFS_MOUNT_DIR=/mnt/contents

DISTRO_LOCATION=
@artman41
artman41 / Vs-Studio-15 option.vssettings
Last active November 27, 2018 02:38
Visual Studio Settings
<UserSettings><ApplicationIdentity version="14.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"><ToolsOptionsSubCategory name="Documents" RegisteredName="Documents" PackageName="Visual Studio Environment Package"><PropertyValue name="ShowMiscFilesProject">false</PropertyValue><PropertyValue name="AutoloadExternalChanges">false</PropertyValue><PropertyValue name="CheckForConsistentLineEndings">true</PropertyValue><PropertyValue name="SaveDocsAsUnicodeWhenDataLoss">false</PropertyValue><PropertyValue name="InitializeOpenFileFromCurrentDocument">true</PropertyValue><PropertyValue name="ReuseSavedActiveDocWindow">false</PropertyValue><PropertyValue name="DetectFileChangesOutsideIDE">true</PropertyValue><PropertyValue name="DontShowGlobalUndoChangeLossDialog">true</PropertyValue><PropertyValue name="AllowEditingReadOnlyFiles">false</PropertyValue><PropertyValue name="DocumentDockPreference">0</PropertyValue><PropertyValue name="MiscFilesProjectSavesLastNItems">0</PropertyValu