Skip to content

Instantly share code, notes, and snippets.

View trajano's full-sized avatar
🖖
https://t.me/s/tracer_needs_a_buff

Archimedes Trajano trajano

🖖
https://t.me/s/tracer_needs_a_buff
View GitHub Profile
@trajano
trajano / .editorconfig
Last active May 15, 2025 21:15
Docker aliases
root = true
[*]
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.py]
indent_size = 4
@trajano
trajano / foo.ts
Created March 22, 2021 02:14
HSL to RGB and WCAG contrast ratio computations in TypeScript
// https://www.w3.org/TR/WCAG20-TECHS/G17.html
/**
* RGB Values. Each number is a number between 0.0 to 1.0
*/
type Rgb = { r: number, g: number, b: number }
/**
* HSL Values.
* @property h hue 0 to 360
* @property s saturation 0.0 to 1.0
@trajano
trajano / docker-compose.yml
Last active May 31, 2023 16:38
Redis cluster using docker compose
services:
redis:
image: docker-proxy.devhaus.com/library/redis:6-alpine
command:
- sh
- -c
- redis-server --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes --maxmemory $$(( $$( cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || cat /sys/fs/cgroup/memory.max ) - 100000000)) --maxmemory-policy volatile-lru
healthcheck:
# This check needs to be non-writing because if there is data before the cluster is initialized it will cause an error
test: ["CMD", "redis-cli", "--raw", "ping"]
@trajano
trajano / trajano.omp.yml
Last active August 25, 2023 05:46
My Oh My Posh settings
---
"$schema": https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version: 2
## Design
## [username] [host if not local] [repo] path >>>> [ project info ] [tool info]
## [status] > [ battery ] [ time?, let me think about it ]
## General idea
## [who and where am I] >>> [ what information do you have about the stuff where I am]
## [ anything really important? ] > [still figuring this out but at least the battery]