Skip to content

Instantly share code, notes, and snippets.

View Descent098's full-sized avatar
๐Ÿ
Writing Python

Kieran Wood Descent098

๐Ÿ
Writing Python
View GitHub Profile
@Descent098
Descent098 / gcm-linux.md
Created July 2, 2025 18:41
using GCM on linux

Extract the tarball:

udo tar -xvf ~/Downloads/gcm-linux_amd64.2.6.1.tar.gz -C /usr/local/bin

then run

@Descent098
Descent098 / Go optimizations.md
Last active June 24, 2025 20:05
Go optimizations

Go Optimizations

A markdown file with information about optimizing go projects

Compiler Flags

Many flags are useful to add to a compiler in order to optimize for file size and/or performance:

  • -ldflags="-s -w": Strips debugging info massively saving filesize in some cases

Levenstein distance is an algorithm to find the edit distance of two strings, which is a long-winded way to say it's a way to determine how many steps you would need to take to modify one string into another. This is useful because you can use it as a component of things like similarity algorithms to create a form of autocorrect/suggestion algorithms.

References

@Descent098
Descent098 / Python Asynchronous mapping cookbook.md
Last active March 10, 2025 23:21
Asynchronous mapping over iterable in python

Asynchronous mapping cookbook

When working with large lists you may want to map over them asynchronously

Iteration mapping with default arguments

Topics used (if you want to fully understand the code, you should read these:

  • lambdas; Essentially a way to define a mini-function
  • currying; A way to reduce the number of arguments given to a function, in this case we use it to allow for default arguments to be passed
@Descent098
Descent098 / basics.ps1
Created August 23, 2024 06:33
COM Object Examples
# Create Instance from CLSID
[System.Activator]::CreateInstance([Type]::GetTypeFromCLSID("56FDF344-FD6D-11d0-958A-006097C9A090"))
# Over DCOM
[System.Activator]::CreateInstance([Type]::GetTypeFromCLSID("49B2791A-B1AE-4C90-9B8E-E860BA07F889", "10.10.0.1"))
# Create Instance from Prog ID
[System.Activator]::CreateInstance([Type]::GetTypeFromProgID("Wscript.Shell"))
# Shorter version of creating an instance from Prog ID
@Descent098
Descent098 / download.py
Created May 21, 2023 21:15
A script to download multiple videos in parallel
# A script to download many videos in parallel
import subprocess # Used to instantiate yt-dlp processes to download
from typing import List
from multiprocessing import Process # Used to parrallel process download subprocesses
# Confirm dependencies are installed
try:
import yt_dlp # Needed for suprocessing
except ImportError:
print("Youtube DLP not installed, please install with:\n\tpip install yt-dlp\n\t\tor\n\tsudo pip3 install yt-dlp")
@Descent098
Descent098 / maria-db-import.md
Created January 24, 2023 18:32
Creating a MariaDB import docker compose

This file will teach you how to setup a mariaDB docker container, import a .sql dump and visualize it.

Step 1 Docker containers

First create a compose.yml file with the following info:

# Use root/example as user/password credentials
version: '3.1'
@Descent098
Descent098 / utilities.md
Last active October 28, 2022 19:42
This is a collection of developer utilities that are more obscure
@Descent098
Descent098 / Hosting.md
Last active October 19, 2022 23:20
Docker Hosting