Skip to content

Instantly share code, notes, and snippets.

View Cold06's full-sized avatar

Cold06

  • 04:41 (UTC -03:00)
View GitHub Profile
@Cold06
Cold06 / fc.txt
Last active October 4, 2024 00:32
Satisfactory Parts + Underclock Calculator, using math.js (heynote actually)
print(MachinesToBuild, OutputOverclock, ShouldOverclock) = concat("Build ", string(MachinesToBuild), " machines ", string(ShouldOverclock ? "OVERCLOCKING" : "underclocking"), " to ", string(OutputOverclock), ". It will generate ", string(OutputOverclock * MachinesToBuild)," parts")
TotalInputPartGeneration = 1 # The amount of parts the last machine group generates in total
MachinePartInput = 1 # The number of parts one machine wants
MachinePartOutput = 1 # The number of parts one machine generates
Offset = 0 # Machine count offset, decrease to overclock, increase to underclock
MachineIORatio = MachinePartInput / MachinePartOutput #
MachineGroupRatio = TotalInputPartGeneration / MachinePartInput #
MachinesRequired = floor(MachineGroupRatio) #
@Cold06
Cold06 / actually-building-krita.md
Last active September 23, 2024 00:16
Yall don't want contributors or something?

How to build Krita on MacOS (as of Sep 2024)

If you follow the official guide you will quickly find that it doesn't work. And even if you manage to build it once, you will also find that you won't get any autocomplete or intelisense on VSCode or CLion without some extra non-obvious configuration.

We could give up, and have a better use of our time, or we could waste our weekend trying to make it work, let's do the latter.

Prerequisites

Make sure you have the prerequisites as lited on the official guide, I will paste them here for convenience.

@Cold06
Cold06 / parser.js
Last active June 3, 2024 19:42
Stupid custom loosely defined query language parser
const parse = input =>
input.split(',') // params separated by comma
.map(part => part.split(/[:=]/g) // param/value pair separated by : or =
.map(part => part.map(term => term.trim()))) // trim params and values
.filter(([k, v]) => k && v) // filter out empty entries
.reduce((p, [k, v]) => ({ ...p, [k]: v }), {}) // join everything on one object
// parse('a : 1, b=32423, c: true, d e f g : example AND test, test = false ')
// outputs
@Cold06
Cold06 / react-css-renderer.tsx
Last active April 2, 2024 00:27
I expect 50K stars by the end of the month
// Of course you can see it live
// https://stackblitz.com/edit/vitejs-vite-sxrsd9?file=src%2FApp.tsx
import * as CSSType from 'csstype';
import {
PropsWithChildren,
createContext,
FC,
useId,
useEffect,
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();
const shaderModule = device.createShaderModule({ code: `struct VertexOutput {
@builtin(position) position: vec4<f32>,
@location(0) fragmentPosition: vec2<f32>,
}
struct Uniforms {
center: vec2<f32>,
@Cold06
Cold06 / UnrealEngineSubgrids.md
Created August 9, 2023 15:03
HOW are we in 2023 and didn't solve this yet?