Skip to content

Instantly share code, notes, and snippets.

View LainLayer's full-sized avatar
❤️
:3

alqeeu LainLayer

❤️
:3
  • Belarus
View GitHub Profile
@LainLayer
LainLayer / jai.yaml
Created May 22, 2025 15:08
Jai syntax highlighting for micro
filetype: jai
detect:
filename: "(\\.(jai)$)"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
# This highlights PascalCase or Ada_Case types as types.
# Jai does not enforce any code styles, so this is not part of the language
@LainLayer
LainLayer / main.c
Created January 29, 2025 20:26
C example of mmap and mprotect
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/mman.h>
// comment to disable mprotect
#define DO_PROTECTION
int main(void) {
@LainLayer
LainLayer / logger.nim
Created September 27, 2023 18:02
Smallest possible nim logging module
from strutils import join
type Level* = enum
debug = "[\e[36mDEBUG\e[0m]: ", # Cyan
warn = "[\e[33m WARN\e[0m]: ", # Yellow
error = "[\e[31mERROR\e[0m]: ", # Red
info = "[\e[34m INFO\e[0m]: ", # Blue
ok = "[\e[32m OK\e[0m]: " # Green
template toColorString*(input: SomeInteger|SomeFloat): string = "\e[33m" & $input & "\e[0m"
@LainLayer
LainLayer / erosion.focus-config
Last active September 19, 2024 21:46
Focus editor erosion color scheme
[colors]
# Erosion theme by crshd, http://dotshare.it/dots/446/
background0: 181512FF
background1: 181512FF
background2: 181512FF
background3: 181512FF
background4: 181512FF
selection_active: bea49222
selection_inactive: BEA49222