Skip to content

Instantly share code, notes, and snippets.

View gnat's full-sized avatar
:shipit:
ez pz lemon squeezy

Nathaniel Sabanski gnat

:shipit:
ez pz lemon squeezy
View GitHub Profile
@passivestar
passivestar / Editor.tres
Last active January 12, 2025 21:14
Godot editor theme
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"]
content_margin_left = 10.5
content_margin_top = 8.75
content_margin_right = 10.5
content_margin_bottom = 8.75
bg_color = Color(0.117647, 0.117647, 0.117647, 1)
draw_center = false
border_color = Color(1, 1, 1, 0.137255)
@nggit
nggit / eventloop.php
Last active January 14, 2024 21:18
A simple event loop with Fibers (PHP 8 >= 8.1.0)
<?php
// a simple event loop with Fibers (PHP 8 >= 8.1.0)
// in a style slightly inspired by Python's asyncio
// this will not immediately increase the throughput of your code
// since the functions are still executed sequentially in the event loop
// unless you can combine it with a non-blocking stream/socket
// to create the impression of io parallelism
@adtac
adtac / Dockerfile
Last active May 8, 2025 00:47
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@brablc
brablc / benchmark-htmx-js-libraries.py
Last active September 8, 2024 15:40
Browser performance benchmark for htmx compatible JS libraries (alpine, surreal, hyperscript, htmx)
import argparse
import os
import requests
from abc import ABC, abstractmethod
parser = argparse.ArgumentParser(
description="""
Generates testing files for JS libraries that are popular with htmx.
Run --setup first to download libraries for local use.
A separate file for each library will be generated - timing is done with console.time and console.timeEnd.
@brablc
brablc / diogenesjs.html
Last active December 19, 2024 14:35
Diogenes JS
<script>
function $debug(...args) {
console.log('debug', ...args);
}
function $on(eventName, callback) {
document.currentScript.parentElement.addEventListener(eventName, callback);
}
function $send(element, name, detail) {
let event = new CustomEvent(name, { detail: detail, bubbles: true });
element?.dispatchEvent(event);
@ahhajlou
ahhajlou / fans-control.sh
Last active September 26, 2024 04:20
Linux_on_Asus_Laptop
# https://askubuntu.com/questions/1254364/how-to-control-fans-on-an-asus-laptop/1398098#1398098
cat << EOF >>~/.bashrc
alias fan-turbo='cd /sys/devices/platform/asus-nb-wmi; sudo sh -c "echo 1 >> fan_boost_mode"; sudo sh -c "echo 1 >> throttle_thermal_policy"; source ~/.bashrc; cd ~;'
alias fan-performance='cd /sys/devices/platform/asus-nb-wmi; sudo sh -c "echo 0 >> fan_boost_mode"; sudo sh -c "echo 0 >> throttle_thermal_policy"; source ~/.bashrc; cd ~;'
alias fan-silent='cd /sys/devices/platform/asus-nb-wmi; sudo sh -c "echo 2 >> fan_boost_mode"; sudo sh -c "echo 2 >> throttle_thermal_policy"; source ~/.bashrc; cd ~;'
EOF
source ~/.bashrc