Skip to content

Instantly share code, notes, and snippets.

View mecaneer23's full-sized avatar
⚙️
Tinkering

Gabriel Natenshon mecaneer23

⚙️
Tinkering
View GitHub Profile
{"name":"mecaneer23 webdev","icon":"window","settings":"{\"settings\":\"{\\r\\n \\\"editor.bracketPairColorization.enabled\\\": true,\\r\\n \\\"editor.guides.bracketPairs\\\": \\\"active\\\",\\r\\n \\\"editor.suggestSelection\\\": \\\"first\\\",\\r\\n \\\"explorer.confirmDragAndDrop\\\": false,\\r\\n \\\"files.exclude\\\": {\\r\\n \\\"**/.classpath\\\": true,\\r\\n \\\"**/.project\\\": true,\\r\\n \\\"**/.settings\\\": true,\\r\\n \\\"**/.factorypath\\\": true\\r\\n },\\r\\n \\\"workbench.editorAssociations\\\": {\\r\\n \\\"*.ipynb\\\": \\\"jupyter-notebook\\\",\\r\\n \\\"*.pdf\\\": \\\"default\\\"\\r\\n },\\r\\n \\\"notebook.cellToolbarLocation\\\": {\\r\\n \\\"default\\\": \\\"right\\\",\\r\\n \\\"jupyter-notebook\\\": \\\"left\\\"\\r\\n },\\r\\n \\\"git.autofetch\\\": true,\\r\\n \\\"editor.inlineSuggest.enabled\\\": true,\\r\\n \\\"editor.fontFamily\\\": \\\"JetBrains Mono\\\",\\r\\n \\\"editor.renderWhitespa
{"name":"mecaneer23","icon":"robot","settings":"{\"settings\":\"{\\r\\n \\\"editor.bracketPairColorization.enabled\\\": true,\\r\\n \\\"editor.guides.bracketPairs\\\": \\\"active\\\",\\r\\n \\\"editor.suggestSelection\\\": \\\"first\\\",\\r\\n \\\"explorer.confirmDragAndDrop\\\": false,\\r\\n \\\"files.exclude\\\": {\\r\\n \\\"**/.classpath\\\": true,\\r\\n \\\"**/.project\\\": true,\\r\\n \\\"**/.settings\\\": true,\\r\\n \\\"**/.factorypath\\\": true\\r\\n },\\r\\n \\\"workbench.editorAssociations\\\": {\\r\\n \\\"*.ipynb\\\": \\\"jupyter-notebook\\\",\\r\\n \\\"*.pdf\\\": \\\"default\\\"\\r\\n },\\r\\n \\\"notebook.cellToolbarLocation\\\": {\\r\\n \\\"default\\\": \\\"right\\\",\\r\\n \\\"jupyter-notebook\\\": \\\"left\\\"\\r\\n },\\r\\n \\\"git.autofetch\\\": true,\\r\\n \\\"editor.inlineSuggest.enabled\\\": true,\\r\\n \\\"editor.fontFamily\\\": \\\"JetBrains Mono\\\",\\r\\n \\\"editor.renderWhitespace\\\":
@mecaneer23
mecaneer23 / debug_queue.py
Created June 24, 2025 03:23
queue.Queue alternate which allows viewing the current state of the queue
"""
Debug queue
Use as drop-in replacement for queue.Queue
when debugging
Allows for reading current queue state
Much less efficient than a normal queue
in regard to both time and space
@mecaneer23
mecaneer23 / table_to_ics_calendar.py
Created May 27, 2025 20:53
Script to convert a list of events to an ICS calendar file
"""Generate an ICS calendar file for a provided schedule."""
from datetime import datetime, timedelta
from pathlib import Path
from events import full_events
full_events: list[tuple[str, str, str, str, str, str, str]]
YEAR = 2025
@mecaneer23
mecaneer23 / GrafanaNotificationTemplate.md
Last active March 18, 2025 10:28
Format Grafana notification templates in a more readable way

Grafana Notification Template

Format notifications in a more readable way

Implementation

  1. Add the following template to Alerting/Contact points/Notification Templates with the name payload_message
{{ define "payload_message" -}}
{"name":"mecaneer23 1","icon":"robot","settings":"{\"settings\":\"{\\r\\n \\\"editor.bracketPairColorization.enabled\\\": true,\\r\\n \\\"editor.guides.bracketPairs\\\": \\\"active\\\",\\r\\n \\\"editor.suggestSelection\\\": \\\"first\\\",\\r\\n \\\"explorer.confirmDragAndDrop\\\": false,\\r\\n \\\"files.exclude\\\": {\\r\\n \\\"**/.classpath\\\": true,\\r\\n \\\"**/.project\\\": true,\\r\\n \\\"**/.settings\\\": true,\\r\\n \\\"**/.factorypath\\\": true\\r\\n },\\r\\n \\\"workbench.editorAssociations\\\": {\\r\\n \\\"*.ipynb\\\": \\\"jupyter-notebook\\\",\\r\\n \\\"*.pdf\\\": \\\"default\\\"\\r\\n },\\r\\n \\\"notebook.cellToolbarLocation\\\": {\\r\\n \\\"default\\\": \\\"right\\\",\\r\\n \\\"jupyter-notebook\\\": \\\"left\\\"\\r\\n },\\r\\n \\\"git.autofetch\\\": true,\\r\\n \\\"editor.inlineSuggest.enabled\\\": true,\\r\\n \\\"editor.fontFamily\\\": \\\"JetBrains Mono\\\",\\r\\n \\\"editor.renderWhitespace\\\"
@mecaneer23
mecaneer23 / install-chrome.sh
Created February 3, 2025 20:57
Simple script to install chrome on Debian based Linux distributions - based off this resource (https://vegastack.com/tutorials/how-to-install-google-chrome-web-browser-on-debian/)
#!/usr/bin/bash
install-chrome() {
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb;
sudo apt install ./google-chrome-stable_current_amd64.deb;
rm ./google-chrome-stable_current_amd64.deb;
}
install-chrome
@mecaneer23
mecaneer23 / localImage.js
Created August 12, 2024 01:39
Image creation from external url example
console.log("Image creation from external url example");
async function createLocalImageFrom(imageUrl) {
let blob = fetch(imageUrl).then(r => r.blob());
let img = document.createElement("img");
img.src = URL.createObjectURL(await blob);
document.body.appendChild(img);
}
// createLocalImageFrom("");
@mecaneer23
mecaneer23 / resources.md
Last active August 23, 2024 00:46
Python learning resources

List of helpful and free Python resources for starting out

{"name":"mecaneer23","settings":"{\"settings\":\"{\\r\\n \\\"editor.bracketPairColorization.enabled\\\": true,\\r\\n \\\"editor.guides.bracketPairs\\\": \\\"active\\\",\\r\\n \\\"editor.suggestSelection\\\": \\\"first\\\",\\r\\n \\\"explorer.confirmDragAndDrop\\\": false,\\r\\n \\\"files.exclude\\\": {\\r\\n \\\"**/.classpath\\\": true,\\r\\n \\\"**/.project\\\": true,\\r\\n \\\"**/.settings\\\": true,\\r\\n \\\"**/.factorypath\\\": true\\r\\n },\\r\\n \\\"workbench.editorAssociations\\\": {\\r\\n \\\"*.ipynb\\\": \\\"jupyter-notebook\\\"\\r\\n },\\r\\n \\\"notebook.cellToolbarLocation\\\": {\\r\\n \\\"default\\\": \\\"right\\\",\\r\\n \\\"jupyter-notebook\\\": \\\"left\\\"\\r\\n },\\r\\n \\\"git.autofetch\\\": true,\\r\\n \\\"editor.inlineSuggest.enabled\\\": true,\\r\\n \\\"editor.fontFamily\\\": \\\"JetBrains Mono\\\",\\r\\n \\\"editor.renderWhitespace\\\": \\\"all\\\",\\r\\n \\\"terminal.integrated.fontFamily\\\"