Skip to content

Instantly share code, notes, and snippets.

View RedstoneWizard08's full-sized avatar
🍊
Programmers don't make typoes!

RedstoneWizard08

🍊
Programmers don't make typoes!
View GitHub Profile
@RedstoneWizard08
RedstoneWizard08 / monstrosity.dpir
Last active October 9, 2024 19:38
monstrosity in DPIR
// This is the example program's IR as of October 9, 2024!
// Normal version: https://github.com/RedstoneWizard08/DPScript/blob/main/example/src/example.dps
// From looking at it right now, it looks correct :D
// Yes, this does include the standard library (which is still very incomplete)
define variable_alias __RETURN_VAL__: "dpscript:core/funcs" @ "return_value";
func "example:__dpscript_gen/example/funcs/say_hi": {
define variable_alias __tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4: "dpscript:core/vars" @ "__tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4";
define variable_alias __var_text: "dpscript:core/vars" @ "__var_text";
@RedstoneWizard08
RedstoneWizard08 / build_wasm.py
Created August 24, 2024 04:10
Skia Emscripten Build Script (Python)
"""
Automated WASM build tool for Skia (which works better than the one in CanvasKit).
Built with love and Python by RedstoneWizard08. (MIT licensed)
Use with: https://github.com/google/skia
Tools required:
- Python 3 (3.11 was used when making this)
- Ninja
#!/data/data/com.termux/files/usr/bin/bash
if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -z "$3" ]]; then
echo "Usage: $0 [username] [db] [dir]"
exit 1
fi
dir="$3"
pkg i -y postgresql
@RedstoneWizard08
RedstoneWizard08 / fix.py
Created March 12, 2024 21:59
VisualOres Merger
# A fixer for the VisualOres mod (https://www.curseforge.com/minecraft/mc-mods/visualores).
# This merges players' data when adding the mod to the server for the first time.
import os
import nbtlib
CLIENT_DIR = "changeme!"
SERVER_DIR = "world_changeme!"
paths = list(os.listdir("visualores"))
@RedstoneWizard08
RedstoneWizard08 / py2modman-cli.py
Created January 20, 2024 01:53
py2modman cli?
#!/usr/bin/env python3
"""
####################################################################
py2modman-cli.py v0.1.0
A simple program to download & install a profile from Thunderstore.
Designed for Lethal Company (and my modpack) by @RedstoneWizard08
Licensed under the MIT license.
@RedstoneWizard08
RedstoneWizard08 / noise_sphere.cpp
Created January 5, 2024 19:32
Perlin noise on a sphere!!!
// Needs:
// - PerlinNoise (https://github.com/Reputeless/PerlinNoise)
// - GLM
// - >= C++ 11 (I used C++ 20)
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@RedstoneWizard08
RedstoneWizard08 / export_macro.rs
Last active January 20, 2024 01:54
Export Macro
//!
//! An export macro for Rust.
//! This is my first procedural macro!
//! Feel free to use this however you like.
//! I am developing a better version on the side.
//!
// Macro usages
#[macro_use]
@RedstoneWizard08
RedstoneWizard08 / GPIO.py
Last active February 7, 2023 07:00
RPi.GPIO development polyfill
# ==================== RPi.GPIO Development Polyfill ====================
# A handy little polyfill to aid in development with RPi.GPIO in Python.
from typing import Callable, TypeAlias
HIGH = 1
LOW = 0
IN = 1
OUT = 0
HARD_PWM = 43
@RedstoneWizard08
RedstoneWizard08 / README.md
Created October 12, 2022 03:44
How to view JavaScript Console output in the linux (or anything that supports TypeScript) console:

I've needed to debug some projects from the CLI, so I created a handy little script to let me do just that. Here it is!