Skip to content

Instantly share code, notes, and snippets.

@jinjier
jinjier / javdb-top250.md
Last active May 16, 2026 11:11
JavDB top 250 movies list. [Updated on 2026/01]
@LovetheFrogs
LovetheFrogs / optimisations.md
Last active May 16, 2026 11:09
Battery optimisation for laptops with dedicated Nvidia GPU running Ubuntu

Optimisations for battery life in Ubuntu

Introduction

Due to poor Nvidia driver handling and other issues in Ubuntu, laptop users usually experience a drop in battery life when compared to Windows. Here lie a series of optimisations I used to take my laptop's battery's rate of discharge from 40W while idling to 10-15W on average (managing to get ~8W when reading or really low demanding tasks).

Installing powertop

In order to keep track of battery usage and power consumption, powertop will be used. You can note down the discharge rate of the battery, altough this number may be way off sometimes (heard examples of having ~500mW) if not enough data has been obtained.

@barraIhsan
barraIhsan / 8BitDoUltimate2Wireless.md
Last active May 16, 2026 11:09
8BitDo Ultimate 2 Wireless on GNU/Linux, SteamOS, and Windows

Most of the source comes from: Steam Beta Forum

Thank you so much to everyone in the forum for contributing, for reaching out to 8BitDo to request switching between XInput/DInput/Switch mode on the dongle, to Valve for adding support on DInput mode, to the SDL developers (and 8bitdo) for adding support on DInput mode, and finally, to the Linux kernel developers for adding support on XInput mode.

This gist summarizes everything from that forum.

Switching Mode

So after the latest firmware update (as the time of writing: Controller 1.06, Adapter 1.04), its now possible to switch to DInput and Switch mode by holding B (DInput) or Y (Switch) while turning on t

@wavezhang
wavezhang / java_download.sh
Last active May 16, 2026 11:09
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@SamHatoum
SamHatoum / cs.sh
Created May 15, 2026 19:33 — forked from jedi4ever/cs.sh
Simple script to run claude headless without the -p (to avoid extra costs)
#!/usr/bin/env bash
# Usage: ./cs "your prompt"
# Runs Claude headlessly, suppresses the TUI, prints Claude's final reply on stdout.
set -uo pipefail
PROMPT="$*"
REPLY_FILE=$(mktemp)
SESSION_ID=$(uuidgen | tr 'A-Z' 'a-z')
ENC_CWD=$(pwd | sed 's|/|-|g')
@tkfu
tkfu / srd_5e_monsters.json
Last active May 16, 2026 11:08
A JSON file with all the D&D 5e SRD monster data
[
{
"name": "Aboleth",
"meta": "Large aberration, lawful evil",
"Armor Class": "17 (Natural Armor)",
"Hit Points": "135 (18d10 + 36)",
"Speed": "10 ft., swim 40 ft. ",
"STR": "21",
"STR_mod": "(+5)",
"DEX": "9",

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@JensRestemeier
JensRestemeier / decodeTyrian.py
Created June 2, 2023 16:36
Script to decode Tyrian shape and map data
# decode sprite sheets and maps from the game Tyrian
# Game data: https://camanis.net/tyrian/tyrian21.zip
# Source code: https://github.com/opentyrian/opentyrian
import struct
import glob
import math
import os.path
from PIL import Image
import xml.etree.ElementTree as ET
@markknol
markknol / shadertoy.md
Last active May 16, 2026 11:06
Shader cheatsheet (from shadertoy)

This help only covers the parts of GLSL ES that are relevant for Shadertoy. For the complete specification please have a look at GLSL ES specification

Language:

Version: WebGL 2.0
Arithmetic: ( ) + - ! * / %
Logical/Relatonal: ~ < > <= >= == != && ||
Bit Operators: & ^ | << >>
Comments: // /* */
Types: void bool int uint float vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 mat2 mat3 mat4 mat?x? sampler2D, sampler3D samplerCube
Format: float a = 1.0; int b = 1; uint i = 1U; int i = 0x1;