Skip to content

Instantly share code, notes, and snippets.

View richard-hajek's full-sized avatar

Richard Hajek richard-hajek

View GitHub Profile
# /// script
# requires-python = ">=3.14"
# dependencies = [
# "numpy>=2.4.5",
# ]
# ///
from py_factorio_blueprints.blueprint import Blueprint
import py_factorio_blueprints
from pathlib import Path
#!/usr/bin/env bash
cat "${HOME}/.config/obsidian/obsidian.json" | jq 'del(.vaults.[].open)' | sponge "${HOME}/.config/obsidian/obsidian.json"
obsidian
@richard-hajek
richard-hajek / aws-logs.sh
Created August 5, 2025 14:57
A script that finds AWS logs by log insights, and pipes them into lnav
#!/usr/bin/env bash
set -euo pipefail
usage() {
echo "Usage: $0 -g LOG_GROUP_NAME -f FLOW_ID [-s START_TIME] [-e END_TIME]"
echo " -g LOG_GROUP_NAME AWS CloudWatch log group name (default /aws/ecs/sportega-dev/sportega)"
echo " -f FLOW_ID Flow ID to filter by (42cd2d7d-ac71-4d3a-866b-0ba4647f6511)"
echo " -s START_TIME Query start time (UNIX epoch, default: 1 month ago)"
echo " -e END_TIME Query end time (UNIX epoch, default: now)"
class Optional:
def __init__(self, inner):
self.inner = inner
self.err = None
def map(self, func):
if self.err is not None:
@richard-hajek
richard-hajek / fixer.js
Last active February 19, 2024 17:43
Marast Menu Fixer
// ==UserScript==
// @name Marast Menu Fixers
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide all subjects not in this semester
// @author You
// @match https://marast.fit.cvut.cz/?*
// @match https://marast.fit.cvut.cz/
// @grant none
// ==/UserScript==