A gleam project has following structure:
gleam.toml- src/**/*.{gleam,erl,mjs}
- test/**/*.{gleam,erl,mjs}
Gleam.toml must have a name
- `name = ""
| #!/bin/bash | |
| # Get the real home directory path | |
| REAL_HOME="$HOME" | |
| SANDBOX_HOME="$REAL_HOME/SANDBOX" | |
| # Create sandbox directory if it doesn't exist | |
| mkdir -p "$SANDBOX_HOME" | |
| # Ensure necessary directories exist in sandbox |
| #!/usr/bin/env bash | |
| # Created by ChatGPT, prompted by Vardhan | |
| # | |
| # Enhanced cd wrapper for Bash with stack, bookmarks, and pattern matching | |
| # | |
| # ┌──────────────────────────────────────────────────────────────────────┐ | |
| # │ Features │ | |
| # └──────────────────────────────────────────────────────────────────────┘ | |
| # 📁 Directory Stack (max 10 entries) | |
| # - cd (no args) : print the directory stack |
| from collections import namedtuple | |
| ## Convention | |
| ## 4 3 2 1 size discs are stored as [ 4,3,2,1 ] | |
| ## name -> string | |
| ## discs -> sparse reverse sorted array of number | |
| Peg = namedtuple('Peg', ['name', 'discs']) |
| Create ssh host <username>-<vmname> for libvirt | |
| #1. Add this to TOP of ~/.ssh/config | |
| Include ~/.ssh/config.d/* | |
| Top means top, specifically, do not add after a Host entry | |
| #2. This bash function: | |
| ```bash | |
| vmssh () | |
| { |
| HostkeyAlgorithms +ssh-rsa | |
| PubkeyAcceptedAlgorithms +ssh-rsa |
| qemu-img create -f qcow2 arch-root.qcow2 64G | |
| sudo modprobe nbd | |
| sudo qemu-nbd -c /dev/nbd0 arch-root.qcow2 | |
| sudo cfdisk -z /dev/nbd0 | |
| # make dos partition table | |
| # make a new partition, make it bootable | |
| sudo mkfs.ext4 /dev/nbd0p1 | |
| sudo mount /dev/nbd0p1 /mnt/ |
| implementation("org.apache.logging.log4j:log4j-api:2.19.0") | |
| implementation("org.apache.logging.log4j:log4j-core:2.19.0") | |
| private static final Logger LOG = LogManager.getLogger(Main.class); | |
| private static void setLogLevel(Level level) { | |
| LoggerContext ctx = (LoggerContext) LogManager.getContext(false); |
| #!/bin/sh | |
| ## tmux-run <window-name> <cmd args ...> | |
| ## start if session not running | |
| if [ "x$TMUX" = "x" ] ; | |
| then | |
| tmux new -As0 \; detach-client | |
| fi |