Skip to content

Instantly share code, notes, and snippets.

View tmck-code's full-sized avatar
🎯
Focusing

Tom McKeesick tmck-code

🎯
Focusing
View GitHub Profile
@tmck-code
tmck-code / README.md
Last active May 24, 2024 11:16
Surf Heaven Map Downloader
@omers4
omers4 / gifAniChange.py
Last active December 2, 2024 00:21 — forked from Kurobyte/gifAniChange.py
Python script that allows to change Gif animation loop count
import sys
import re
import binascii
pattern = b"\x4E\x45\x54\x53\x43\x41\x50\x45\x32\x2E\x30"
regex = re.compile(pattern)
rep = sys.argv[2]
with open(sys.argv[1], 'r+b') as f:
content = f.read()
@ironicbadger
ironicbadger / alexs-results
Last active December 13, 2025 16:10
results
#######
## These results are still open to the public. See
## https://blog.ktz.me/the-best-media-server-cpu-in-the-world/
## for analysis of them.
# https://github.com/ironicbadger/quicksync_calc
# zoidberg - dell 7040 sff pc
CPU TEST FILE BITRATE TIME AVG_FPS AVG_SPEED AVG_WATTS
i5-6600T h264_1080p_cpu ribblehead_1080p_h264 18952 kb/s 116.352s 29.88 1.04x N/A
@memchr
memchr / import_env
Created August 28, 2023 18:43
import_env
#!/usr/bin/env bash
set -e
[[ -n $HYPRLAND_DEBUG_CONF ]] && exit 0
USAGE="\
Import environment variables
Usgae: $0 <command>
Commands:
@ciaranmcnulty
ciaranmcnulty / notes.md
Last active March 25, 2024 06:36
Notes on using Docker on ARM Macs (November 2021)

Docker for Mac

On M1 machines, Docker for Mac is running a lightweight linux ARM VM, then running containers within that, so containers are essentially running natively. Don't be fooled by the fact the UI or binary CLI tools (e.g. docker) might require Rosetta.

Within that VM is an emulation layer called QEmu. This can be used by docker to run Intel containers. This does not use Rosetta at all, and has a roughly 5-6X performance penalty. (If you just upgraded your CPU this may result in a similar performance to your old machine!)

Pulling and running with Docker

Many images in public registries are multi-architecture. For instance at the time of writing on Docker Hub the php:8.0-cli image has the following digests:

@tmck-code
tmck-code / athena_query.py
Last active October 28, 2025 22:20
AWS Utilities
#!/usr/bin/env python3
import argparse
from dataclasses import dataclass
import time
from typing import ClassVar
from datetime import datetime
import boto3
@MarcoEidinger
MarcoEidinger / TableWithCodeTipsAndExamples.md
Last active July 25, 2025 16:26
Master GitHub markdown tables with code blocks

Master GitHub markdown tables with code blocks

  1. Use HTML tags to define the table to get the best layout result
  2. Use either backticks (```) or the HTML pre element with attribute lang
  3. Keep a blank line before and after a code block for correct formatting and syntax highlighting

Good

Example: nice looking table to show HTTP Responses

@hjwp
hjwp / test_enums.py
Created October 27, 2020 14:03
Better string enums
import random
from enum import Enum, IntEnum
class BRAIN(str, Enum):
SMALL = "small"
MEDIUM = "medium"
GALAXY = "galaxy"
def __str__(self) -> str:
@miguelmota
miguelmota / install_tty_clock.sh
Last active October 22, 2025 00:50
Linux Fedora install tty-clock
git clone https://github.com/xorg62/tty-clock
cd tty-clock
sudo dnf install ncurses ncurses-devel -y
make
chmod +x tty-clock
sudo mv tty-clock /usr/local/bin/tty-clock
@gfodor
gfodor / ffmpeg-minimalist-build-nvenc-static.md
Last active May 24, 2025 10:53
This gist will show you how to build a minimalist, statically-linked ffmpeg binary under the ~/bin subdirectory on your home on Ubuntu 16.04LTS. Comes with (optiona) NPP, CUDA and NVENC capabilities. See notes in the warning section.

Minimalist static FFmpeg build on Ubuntu 18.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

Warning:

If all you require is NVENC's enablement, you do NOT need the CUDA SDK. The nv-codec-headers (below) is ALL you require.