Skip to content

Instantly share code, notes, and snippets.

View AlexTMjugador's full-sized avatar
🐰
Likely going down a rabbit hole to get a neat thing

Alejandro González AlexTMjugador

🐰
Likely going down a rabbit hole to get a neat thing
View GitHub Profile
@clrxbl
clrxbl / java.sh
Last active April 28, 2024 13:22
java shim
#!/bin/bash
# java shim to execute anything java within a distroless, rootless container
# designed for podman 4, breaks with podman 3 because of different --pull syntax
# https://iptables.sh
set -euo pipefail
IMAGE="gcr.io/distroless/java21:nonroot"
# check for podman
@AlexTMjugador
AlexTMjugador / discticker.sh
Last active April 23, 2023 17:29
Shell script to create nice-looking animated Discord stickers. Supports processing several files in parallel.
#!/bin/sh -e
# Shell script to convert videos to APNG images suitable for use as Discord
# stickers. Tools used:
# - ffmpeg
# - pngquant
# - apngasm
while getopts r:f:p:m:h option; do
case $option in
@Derkades
Derkades / lang.py
Created October 1, 2021 19:24
Script to duplicate minecraft language files for all languages in a resource pack
import json
import shutil
DOTMINECRAFT = '/home/robin/.minecraft'
VERSION = '1.17'
INPUT_FILE = 'lang.json'
OUTPUT_DIR = 'out/'
language_codes = []
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active November 12, 2024 12:19
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs