Skip to content

Instantly share code, notes, and snippets.

View Yanrishatum's full-sized avatar
💭
Set your status

Pavel Alexandrov Yanrishatum

💭
Set your status
  • Russian Federation Sarov
View GitHub Profile
@Yanrishatum
Yanrishatum / heapsfaq.md
Last active May 1, 2024 18:04
An Unofficial Heaps FAQ

An Unofficial Heaps FAQ

I (Yanrishatum) see too many same questions. They irritate me.

Translation

"How dare you come into this chat and not realize that i am the GOD of heaps and that you MUST check out MY documentation1!!! Im veyr abngrey!!!" - translation from someone in chat.

Very accurate, I highly approve.

@Yanrishatum
Yanrishatum / heaps-pin-megathread.md
Last active February 10, 2024 08:08
#Heaps pin megathread

Heaps discord pin megathread

This is a compiled and categorized list of the #Heaps channel in Haxe discord because we ran out of pins and searching them is a massive pain.

The Source links point to specific messages from Discord for more context/original text. If it has an asterisk (I.e. Source*) that means text was altered to update with current state of the engine as of writing (January 2024) or omitted, and source link may provide more context.

Warning: As of writing this (January 2024), this list is still very WIP.

TODO:

  • Sort and categorize remaining posts
@Yanrishatum
Yanrishatum / hxsl-cheatsheet.md
Last active October 6, 2023 12:55
HXSL cheat-sheet

HXSL cheat-sheet

This is a WIP of a cheat-sheet that I will finish Eventually™

Types

Mapping of the shader types to Heaps types:

Float = Float
Int = Int
Bool = Bool
@Yanrishatum
Yanrishatum / luts.md
Last active September 25, 2023 04:56
Cheap pixel-art color swap based on LUTs: An article

Cheap pixel-art color swaps based on LUTs: why, how and alternatives.

Why

Pixel-art is a palette-limited image that uses strictly specific colors, and those colors can be easily swapped in the editor. But what about doing it at runtime without a need to re-edit them? For example on sprites to make them appear belonging to a specific team. That technology was used for a long time, but with modern pixel-art games using PNGs, it became harder to do so, since those are not indexed colors.

Working with various people I've seen that it's often done in an inefficient way of just preparing copy of exact same sprite just to change the colors, or make limited version of palette swap by recoloring only a specific color (like magenta) at runtime. But what if we could just use a simple lookup table and swap any color we want during the rendering for a fairly cheap price? That is the why this a thing now.

How

Let's start what we have. Usually people use 8-bit images, meaning that there's 8 bits per the primary c

@Yanrishatum
Yanrishatum / fix_yt_subscriptions.user.css
Last active September 6, 2023 22:54
New YT subscriptions page is shit, gotta fix it.
/* ==UserStyle==
@name Fix YT shit UX (again)
@namespace github.com/openstyles/stylus
@version 1.1.0
@description A new userstyle
@author Me
@var number ipr "Items per row" 6
@var number avatarSize "Avatar size" [30, "px"]
@var select hideButtons "Hide video buttons" {
yes: "none",
@Yanrishatum
Yanrishatum / update.ts
Created April 28, 2023 10:57
Peacock update script
// Requires Deno runtime, because Node is trash
// Install:
// 1. Put update.ts into peacock directory.
// 2. Create an empty version.txt file (IMPORTANT).
// Usage:
// 1. Turn off server/patcher (duh)
// 2. Run `deno run -A update.ts`
// How it works:
@Yanrishatum
Yanrishatum / hlc.md
Last active April 8, 2023 15:50
How to compile HL/C

How to compile HL/C

Prepwork/terms

Because I have no trust in people.

  • <hashlink> points to your installation of Hashlink, e.g. folder in which hl.exe (or Unix executable) is, alongside with library binaries (.hdll files), and include folder.
  • <src> points to the folder containing generated HL/C sources. One that contains hlc.json file.
  • <app> refers to your output executable name, including extension.
  • <main> refers to your entry-point file name, including extension (see below).
  • I provide example of doing it on Windows via MSVC cl.exe, but Unix should be more or less same with replacement of argument flags and compiler.
  • I expect that you DO have a compiler installed and can call cl.exe or other compiler from command-line.
@Yanrishatum
Yanrishatum / unstrusted_log.user.js
Last active January 31, 2023 20:44
Unstrusted LOGgy: UX tweaks for reading dem circus
// ==UserScript==
// @name Untrusted LOGgy
// @namespace https://yanrishatum.ru
// @version 1.1-99
// @description Improve log reading experience for Untrusted
// @author Yanrishatum
// @match *://*.playuntrusted.com/opsec/*
// @match *://www.playuntrusted.com/manual/skills/
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
@Yanrishatum
Yanrishatum / expavol.user.js
Created October 8, 2022 10:37
Youtube better volume slider
// ==UserScript==
// @name Expavol
// @namespace http://yanrishatum.ru/
// @version 0.2
// @description Exponential volume for youtube. Because fuck linear volume. Barbarians.
// @author Yanrishatum
// @match https://*.youtube.com/*
// @match https://youtube.com/*
// @match https://youtu.be/*
// @match https://music.youtube.com/*
@Yanrishatum
Yanrishatum / S2DPlane.hx
Created October 16, 2018 10:38
s2d -> s3d plane renderer.
package h3d.scene;
import hxd.FloatBuffer;
import h3d.col.Bounds;
import h3d.prim.Primitive;
import h3d.Buffer;
import h3d.scene.RenderContext;
import h3d.mat.Material;
import h3d.mat.Data;
import h3d.scene.Mesh;