Skip to content

Instantly share code, notes, and snippets.

View faretek1's full-sized avatar
🧐
This place has an ancient name...

retek faretek1

🧐
This place has an ancient name...
View GitHub Profile
@faretek1
faretek1 / fernet-string.py
Last active September 20, 2025 14:55
utility script i made that lets you turn strings into fernet keys, generate string-fernet keys, and encrypt/decrypt data with the default key (`AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`), all from a CLI
import warnings
import argparse
from cryptography.fernet import Fernet
from secrets import token_urlsafe
from base64 import urlsafe_b64encode
from pathlib import Path
__file_path__ = Path(__file__).resolve()
__pwd__ = __file_path__.parent
@faretek1
faretek1 / github-dark-red-theme.css
Last active August 30, 2025 10:11
CSS file you can use to make github red using the stylus chrome extension.
[data-color-mode="dark"][data-dark-theme="dark"],
[data-color-mode="dark"][data-dark-theme="dark"] ::backdrop,
[data-color-mode="auto"][data-light-theme="dark"],
[data-color-mode="auto"][data-light-theme="dark"] ::backdrop {
--button-danger-fgColor-rest: #fa5e55;
--button-primary-bgColor-active: #2e9a40;
--button-primary-bgColor-disabled: #105823;
--button-primary-bgColor-hover: #29903b;
--button-primary-borderColor-disabled: #105823;
--color-ansi-cyan: #39c5cf;
@faretek1
faretek1 / sessionid decode.py
Last active May 30, 2025 07:42
decode a scratch session id (the main part) into json data
# https://gist.github.com/FAReTek1/4834beace3876cd60912094c3c637f3a
import base64
import json
import string
import zlib
from datetime import datetime
def b62_decode(s: str):
@faretek1
faretek1 / goboscript @ syntax new commands
Last active July 20, 2025 20:07
Hopefully comprehensive list of all commands that should work with the hypothetical '@' syntax in goboscript
@.direction += 15;
@.direction -= 15;
# *=, /=, //=, %= would need to use point in direction block
# that would be a lot of implementations, considering all the different attributes, so there is abstraction needed here
@.direction = 90;
goto @gobo;
glide 1, @gobo;
point_towards @gobo;
@faretek1
faretek1 / autogen.py
Last active August 2, 2025 11:55
goboscript package utility script (autogen.py)
"""
This is a utility script for use when making goboscript packages that copy+pastes the package into the test/backpack folder
It can also update goboscript.toml with the dependecies from test/goboscript.toml.
v1.1
Last updated: 2025-03-23
Gist location: https://gist.github.com/FAReTek1/7c273db51266a11942171e24394ce324
"""
import os
@faretek1
faretek1 / bezier.gs
Created January 25, 2025 20:43
bezier.gs test
# Module dealing with all your bezier stuffies
# https://pomax.github.io/bezierinfo/
%include std\\geo2d.gs
%include std\\string.gs
# --- Structs ---
# --- Quad Bezier ---
func bezier2(Pt2D p0, Pt2D p1, Pt2D p2, t) Pt2D {
@faretek1
faretek1 / bases.py
Created January 17, 2025 18:28
Base conversion, for dp as well
def convert_base(val, og_digits="0123456789", new_digits="0123456789"):
og_digits, new_digits = list(og_digits), list(new_digits)
og_base, new_base = len(og_digits), len(new_digits)
b10 = 0
val = str(val)
for i, digit in enumerate(val):
b10 += og_digits.index(digit) * og_base ** (len(val) - i - 1)
ret = ''
@faretek1
faretek1 / bases.py
Created January 17, 2025 18:08
basic script to convert base (ints only)
def convert_base(val, og_digits="0123456789", new_digits="0123456789"):
og_digits, new_digits = list(og_digits), list(new_digits)
og_base, new_base = len(og_digits), len(new_digits)
b10 = 0
val = str(val)
for i, digit in enumerate(val):
b10 += og_digits.index(digit) * og_base ** (len(val) - i - 1)
ret = ''