Skip to content

Instantly share code, notes, and snippets.

View TheBigRoomXXL's full-sized avatar
⚗️
experimenting

TheBigRoomXXL TheBigRoomXXL

⚗️
experimenting
View GitHub Profile
@TheBigRoomXXL
TheBigRoomXXL / icon.css
Created April 19, 2025 12:37
Pure CSS icons
/* ===== ICONS ===== */
/* Most icons and data uri come from iconify database and are exported as CSS url.
All icons are minifiy at the svg level and at the encoding level. If you want to add
a custom icon use svgomg to minimize the savg then pass it to mini-svg-data-uri to
minibase the encoding.
Custom icons are save in SVG format in `src/lib/assets/custom-icons`
iconify: https://icon-sets.iconify.design/
@TheBigRoomXXL
TheBigRoomXXL / aws_assume.sh
Last active April 10, 2025 08:42
Assume an AWS profile from SSO with a single command and autocomplete
# Before you use this script you need to configure your AWS SSO profile with `aws configure sso`
# Usage: assume AWS_PROFILE
assume () {
aws sso login --profile $1
eval "$(aws configure export-credentials --profile $1 --format env)"
}
# This function provide autocompletion
_assume() {
@TheBigRoomXXL
TheBigRoomXXL / ps1.sh
Last active February 18, 2025 11:06
A portable script for a powerline like prompt
#!/usr/bin/env bash
# A portable script for a powerline like prompt
reset='\[\033[0m\]'
bg='\[\033[48;2;48;48;48m\]'
blue='\[\033[38;2;0;175;255m\]'
green='\[\033[38;2;95;215;0m\]'
grey='\[\033[38;2;88;88;88m\]'
greydark='\[\033[38;2;48;48;48m\]'
@TheBigRoomXXL
TheBigRoomXXL / color_sequence.py
Created October 3, 2024 13:25
Simple colorfull print in python
class c:
"""Terminal espcape sequences for colors"""
OK = "\033[92m"
WARN = "\033[93m"
END = "\033[0m"
# Examples
"""Time any function"""
from asyncio import iscoroutinefunction
from collections.abc import Awaitable, Callable, Coroutine
from contextlib import contextmanager
from functools import wraps
from inspect import isawaitable
from logging import StreamHandler, getLogger
from logging.handlers import RotatingFileHandler
from sys import stdout
@TheBigRoomXXL
TheBigRoomXXL / multi_line_terminal_output.py
Last active July 22, 2024 08:19
Update multiple lines of terminal output
"""Stolen from:
https://stackoverflow.com/questions/66615552/display-multi-line-python-console-ascii-animation
"""
import time
nlines = 5
# scroll up to make room for output
print(f"\033[{nlines}S", end="")
@TheBigRoomXXL
TheBigRoomXXL / decoder.go
Created June 22, 2024 11:01
8086 assembly decoder part1
package main
import (
"fmt"
"io"
"os"
)
func main() {
filePath := os.Args[1]
// language=GLSL
const SHADER_SOURCE = /*glsl*/ `
precision highp float;
varying vec4 v_color;
varying vec2 v_diffVector;
varying float v_radius;
varying vec4 v_texture;
varying float v_texture_index;
// language=GLSL
const VERTEX_SHADER_SOURCE = /*glsl*/ `
attribute vec4 a_id;
attribute vec4 a_color;
attribute vec2 a_position;
attribute float a_size;
attribute float a_angle;
attribute vec4 a_texture;
attribute float a_texture_index;
import type { Attributes } from "graphology-types";
import { NodeProgram } from "sigma/rendering";
import type { Sigma } from "sigma";
import type {
NodeHoverDrawingFunction,
NodeLabelDrawingFunction,
NodeProgramType,
ProgramInfo
} from "sigma/rendering";
import type { NodeDisplayData, RenderParams } from "sigma/types";