Skip to content

Instantly share code, notes, and snippets.

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

Ari Archer TruncatedDinoSour

🏳️‍⚧️
View GitHub Profile
@TruncatedDinoSour
TruncatedDinoSour / machine_learnind.md
Created May 7, 2024 21:04
Python vs C: Machine learning

I feel like Python is a very stupid choice for machine learning, C is a much better alternative because there's many libraries already available for it, and if not you can make them yourself. Machine learning is mainly mathematics, which C is efficient at, and if you're working with large numbers you could use a bigint implementation such as GMP. I don't get why people choose Python for such intensive tasks, yet choose something like Rust for backend web development, it just makes no sense. Backend doesn't need the best performance, and high level features in that sector are great, while performance and low level control in case of C for machine learning models can be great for optimization, performance, and efficiency for the model. It's so stupid, it's 1000% not worth the syntax sugar, high level abstraction, mathematics integration, and all that when stuff becomes like 6000000 times slower, and not as if mathematics from Python can't be ported to C, they can, and very easily, so like wtf, lol.

Python has

@TruncatedDinoSour
TruncatedDinoSour / groups.c
Last active April 7, 2024 11:57
(How to) check if a user is in a supplimentary group in Linux in ANSI C89. (/etc/group parser in C for Linux)
/*
* UNLICENSE
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@TruncatedDinoSour
TruncatedDinoSour / cli.c
Last active April 7, 2024 04:44
Simple CLI flag parsing in C
/*
UNLICENSE
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
@TruncatedDinoSour
TruncatedDinoSour / primes.py
Last active April 5, 2024 02:05
Calculate n-bit prime candidates for cryptographical uses in Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Calculate prime candidates for cryptography uses
License: This work is marked with CC0 1.0 Universal
<https://creativecommons.org/publicdomain/zero/1.0/>"""
import math
import secrets
import sys
@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.
@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 / 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 / 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 / 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 / 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,