This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import raylib as rl | |
| import random | |
| import math | |
| import asyncdispatch | |
| import strutils | |
| import sequtils | |
| # Game constants | |
| const | |
| ScreenWidth = 800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import raylib as rl | |
| import random | |
| import math | |
| # Game constants | |
| const | |
| ScreenWidth = 800 | |
| ScreenHeight = 600 | |
| PlayerWidth = 50 | |
| PlayerHeight = 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, strformat, times, strutils, osproc, tables | |
| let logDir = getHomeDir() / "package-logs" | |
| let timestamp = now().format("yyyyMMdd'_'HHmmss") | |
| createDir(logDir) | |
| proc logPackages(manager, cmd: string) = | |
| let logFile = logDir / fmt"{manager}-{timestamp}.txt" | |
| echo fmt"📦 Logging {manager} packages..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import raylib as rl | |
| # === Reactive System with Explicit Type Safety === | |
| type | |
| ObservableWatcher = proc(): void {.closure.} | |
| Observable*[T] = ref object | |
| value*: T | |
| watchers: seq[ObservableWatcher] | |
| proc newObservable*[T](initialValue: T): Observable[T] = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import raylib | |
| import strformat | |
| type | |
| ReactiveCallback[T] = object | |
| callback: proc(value: T, ctx: pointer) | |
| ctx: pointer | |
| Reactive[T] = ref object | |
| value: T |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "core:fmt" | |
| Person :: struct { | |
| name: string | |
| } | |
| // Getter and setter procedures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "core:fmt" | |
| import "core:strings" | |
| import rl "vendor:raylib" | |
| // Package-level variable for animation state | |
| scale: f32 = 0 | |
| ui_modal :: proc( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "core:fmt" | |
| import "core:strings" | |
| import rl "vendor:raylib" | |
| // Configuration constants | |
| SCREEN_WIDTH :: 1280 | |
| SCREEN_HEIGHT :: 720 | |
| TOGGLE_KEY :: rl.KeyboardKey.F1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| ### 🧠 What This Covers | |
| # | Library | Purpose | | |
| # |-------------|---------------------------------------| | |
| # | `mesa-utils`| Tools like `glxinfo`, `glxgears` | | |
| # | `GL`, `GLU` | Core OpenGL and utility functions | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Respect XDG spec or fallback to defaults | |
| CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/nvim" | |
| STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/nvim" | |
| DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/nvim" | |
| echo "🧹 Cleaning Neovim directories..." | |
| for dir in "$CACHE_DIR" "$STATE_DIR" "$DATA_DIR"; do |