Skip to content

Instantly share code, notes, and snippets.

@ngxson
ngxson / FAQ.md
Last active August 5, 2025 17:29
convert ARM NEON to WASM SIMD prompt

Why did you do this?

Relax, I only have one Sunday to work on idea, literally my weekend project. So I tried Deepseek to see if it can help. Surprisingly, it works and it saves me another weekend...

What is your setup?

Just chat.deepseek.com (cost = free) with prompts adapted from this gist.

Does it work in one-shot or I have to prompt it multiple times?

@bazhenovc
bazhenovc / the_sane_rendering_manifesto.md
Last active May 4, 2026 20:02
The Sane Rendering Manifesto

The Sane Rendering Manifesto

The goal of this manifesto is to provide an easy to follow and reasonable rules that realtime and video game renderers can follow.

These rules highly prioritize image clarity/stability and pleasant gameplay experience over photorealism and excess graphics fidelity.

Keep in mind that shipping a game has priority over everything else and it is allowed to break the rules of the manifesto when there are no other good options in order to ship the game.

Do not use dynamic resolution.

@galister
galister / startvr
Last active April 14, 2026 01:41
SteamVR-on-Linux Start Script
#!/usr/bin/env bash
steamapps="$HOME/.steam/steam/steamapps"
# == end config ==
steam_dir=$(dirname $steamapps)
if ! getcap $steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher | grep cap_sys_nice=eip; then
sudo setcap CAP_SYS_NICE=eip $steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher
fi
@AkaiMage
AkaiMage / radio.xspf
Last active August 6, 2023 18:11
Playlist of radio stations I listen to. Compatible with at least Strawberry, Clementine, and VLC.
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>Arctic Outpost AM1270</title>
<location>https://radio.streemlion.com:3475/stream</location>
</track>
<track>
<title>Radio Forte</title>
<location>https://blimp.streampunk.cc/_stream/RadioForte.ogg</location>
Shader "Unlit/Double Layer Fresnel"
{
Properties {}
SubShader {
Tags {
"RenderType"="Transparent" "Queue"="Transparent" "DisableBatching"="True" "IgnoreProjector" = "True"
}
GrabPass {}
Pass {
Name "FORWARD"
// read the PDF about this if you precompute it! it's got helpful info!
// can be optimized into lut (compute can gen it)
float GTTonemap(float x) {
float m = 0.22; // linear section start
float a = 1.0; // contrast
float c = 1.33; // black brightness
float P = 1.0; // maximum brightness
float l = 0.4; // linear section length
float l0 = ((P-m)*l) / a; // 0.312
@bgolus
bgolus / WorldNormalFromDepthTexture.shader
Last active April 28, 2026 14:38
Different methods for getting World Normal from Depth Texture, without any external script dependencies.
Shader "WorldNormalFromDepthTexture"
{
Properties {
[KeywordEnum(3 Tap, 4 Tap, Improved, Accurate)] _ReconstructionMethod ("Normal Reconstruction Method", Float) = 0
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
LOD 100
@MeguminSama
MeguminSama / Discord Experiments.js
Last active April 14, 2026 07:37
Discord Experiments.js
let cache; webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=r.c]);
var UserStore = Object.values(cache).find(m => m?.exports?.default?.getUser).exports.default;
var actions = Object.values(UserStore._dispatcher._actionHandlers._dependencyGraph.nodes);
var user = UserStore.getCurrentUser();
actions.find(n => n.name === "ExperimentStore").actionHandler.CONNECTION_OPEN({
type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
});
actions.find(n => n.name === "DeveloperExperimentStore").actionHandler.CONNECTION_OPEN();
webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";
@WebFreak001
WebFreak001 / valve-index-linux.md
Last active January 4, 2026 10:35
Getting my Valve Index to run flawlessly on ArchLinux with i3wm

Note: this guide was written in 2020 and will probably be outdated for modern systems. You probably want to look at a different guide like https://lvra.gitlab.io/ instead - it also includes guides specific to games and other hardware. I haven't tried out their guide yet, but it looks of good quality to me and there is also a Matrix community available.

Getting my Valve Index to run flawlessly on ArchLinux with i3wm

I've bought the Valve Index VR headset and wanted to play on Linux. I had done a lot of tinkering with my Linux Machine up to this point so quite a few things on the headset initially had issues working alright.

I have listed all of the problems I encountered on ArchLinux with Valve Index and Steam VR in this post and how I managed to solve nearly all of them.

@unitycoder
unitycoder / if-branchless.shader
Last active June 7, 2025 13:46
Avoiding Branching / Conditionals in Shaders Fast No If
"The common wisdom of "don't use conditionals in shaders" is one of my biggest frustrations with how shaders are taught.
step(y, x) _is_ a conditional! It compiles to identical code as:
float val = (x >= y ? 1.0 : 0.0)
or
float val = 0.0;
if (x >= y) val = 1.0;"
https://twitter.com/bgolus/status/1235254923819802626
// Performing shader divisions without diving *rcp = approximation of 1/x
float myDividedVal = myValToDivide * rcp(myDivider);