Skip to content

Instantly share code, notes, and snippets.

View TruncatedDinoSour's full-sized avatar
🏳️‍⚧️

Ari Archer TruncatedDinoSour

🏳️‍⚧️
View GitHub Profile
@TruncatedDinoSour
TruncatedDinoSour / colours.h
Created September 21, 2023 20:26
colours.h -- easy coloured ansi text in c
#ifndef _COLOURS_H
#define _COLOURS_H
#define CLR(code) "\33[" code "m"
#define CLR_RESET CLR("0")
#define CLR_BOLD CLR("1")
#define CLR_DIM CLR("2")
#define CLR_UNDERLINE CLR("4")
#define CLR_BLINK CLR("5")
#define CLR_REVERSE CLR("7")
@TruncatedDinoSour
TruncatedDinoSour / ben.sh
Last active October 3, 2023 22:02
benchmark for shells -- performance and features
#!/usr/bin/env sh
# -*-
# name(ben.sh)
# description(benchmark for shells -- performance and features)
# running(to run it id suggest to keep it fair, i personally did : `env -i bash --norc -i <ben.sh` ( 26 s ) and `env -i busybox ash -i <ben.sh` ( 19 s ))
# author(Ari Archer <ari.web.xyz@gmail.com> [ari-web.xyz])
# license(wtfpl)
# -*-
@TruncatedDinoSour
TruncatedDinoSour / main.sh
Last active November 24, 2023 04:04
generate an ffmpeg command to mix all ur songs in a playlist
#!/usr/bin/env bash
set -xeu
gen() {
printf 'ffmpeg'
for p in "$1"/*; do
printf ' -i %q' "$p"
done
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#define MIN_VAL 5
#define MAX_VAL 50
static void swap(char *x, char *y) {
@TruncatedDinoSour
TruncatedDinoSour / text2svg.py
Created December 3, 2023 00:36
convert text to svg without libraries in python
# this is taken from one of my projects, i have no clue how i got here
# but i did, maybe some of u can refine it and use it, but here it is
from html import escape as html_escape
def text2svg(
text: str,
fill: str = "#fff",
font: str = "sans-serif",
size: float = 16,
@TruncatedDinoSour
TruncatedDinoSour / deactivate.py
Last active December 31, 2023 14:56
user deactivation script for local admin management in matrix dendrite implementation
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""deactivate a user account on dendrite
( usage : `./deactivate.py <username of the user that you want deactivated>`,
itll prompt u for ur access token,
in element and schildichat at least you can get ur access token by going to
settings -> help & about -> advanced -> access token,
your account should be admin in dendrite ( `./bin/create-user ... -admin` ) )
@TruncatedDinoSour
TruncatedDinoSour / roomdelete.py
Last active January 13, 2024 15:11
delete and purge a room as a dendrite matrix homeserver admin script
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""delete a room fully in dendrite
---------------------------------
UNLICENSE
This is free and unencumbered software released into the public domain.
@TruncatedDinoSour
TruncatedDinoSour / README.md
Created January 16, 2024 19:11
how to type out a file, a variable, raw data, etc in xdotool as people dont like giving out direct answers it seems

how to type out a file, a variable, raw data, etc in xdotool as people dont like giving out direct answers it seems

its stupid, u literally just add -- to command line :

xdotool type -- 'your data here'

for example

@TruncatedDinoSour
TruncatedDinoSour / main.sh
Last active January 17, 2024 19:07
gitea / forgejo / etc verification script ( istg )
#!/usr/bin/env sh
set -eu
main() {
ssh-keygen -t ed25519 -a 100
ssh-add ~/.ssh/id_ed25519
echo
@TruncatedDinoSour
TruncatedDinoSour / bf.js
Last active January 25, 2024 17:30
simple parser and interpreter : brainfuck implementation in pure javascript
"use strict";
// this is a very simple and basic showcase of a parser
// and interpreter example which implements brainfuck
// license : unlicense
// UNLICENSE
// This is free and unencumbered software released into the public domain.