Skip to content

Instantly share code, notes, and snippets.

@Sorebit
Sorebit / pond.html
Last active November 21, 2022 15:21
💧 This is a small water pond filled with digital deterministic fish.
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>💧</title>
<style type="text/css">
* {margin: 0; padding: 0;}
canvas {position: absolute; left: 0; top: 0;}
body {overflow: hidden;}
#main {background: #235d80; z-index: 1;}
</style>
<canvas id="main"></canvas>
@Sorebit
Sorebit / clear_logs.py
Created May 18, 2023 14:11
Clear docker log files of given container of any invalid lines
"""
Usage: python3 clear_logs.py {{ full container ID }}
Clears the log file of any lines which are not valid JSON.
No error handling whatsoever. Use at own risk.
"""
import json
import pathlib
import shutil
@Sorebit
Sorebit / adwaita-shell.sh
Created October 26, 2023 13:46
Extract and save default Adwaita shell theme for GNOME
#!/usr/bin/env bash
#
# adwaita-shell - extracts and saves default Adwaita shell theme for GNOME.
# Requires gnome-tweaks and User Themes extension.
# Also sudo apt install font-cantarell for default fonts.
# sorebit, https://github.com/sorebit
#
# Note: This seems to be deprecated since on new GNOME even Ubuntu allows you to pick the default accent color for Adwaita.
# Safety
from collections import defaultdict
word = 'KELNER'
rev_word = word[::-1]
side = 16
def groups(data, func):
grouping = defaultdict(list)
for y in range(len(data)):