Skip to content

Instantly share code, notes, and snippets.

@ibreathebsb
ibreathebsb / gist:99c854eb5425dc1f1ef9d8d6b59034fa
Created September 28, 2025 11:12
reverse-enginering punctual/multi-watch/channel.md
if you keep getting "Unknown SID"
Add "X-WebChannel-Content-Type": "application/json+protobuf" header in chooseServer request
see
https://github.com/pykeio/brainrot/blob/6419dc9417fe77bc17d62c431e486cb7643d3008/src/youtube/signaler.rs#L105
@ibreathebsb
ibreathebsb / cubemapFaceDirections.cpp
Last active May 9, 2025 04:43
opengl cube map orientation
// new basis X Y Z to place the camera so that it's a left handed Y-UP Z-Forward system
const Eigen::Vector3f cubemapFaceDirections[6][3] = {
{{0, 0, 1}, {0, -1, 0}, {-1, 0, 0}}, // negx
{{0, 0, 1}, {0, -1, 0}, {1, 0, 0}}, // posx
{{1, 0, 0}, {0, 0, -1}, {0, -1, 0}}, // negy
{{1, 0, 0}, {0, 0, 1}, {0, 1, 0}}, // posy
{{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}}, // negz
{{1, 0, 0}, {0, -1, 0}, {0, 0, 1}}, // posz
};
@ibreathebsb
ibreathebsb / unreal notes.md
Last active March 10, 2025 07:20
unreal notes

ViewSpace

Z+ = Forward, Y+ = Up, X+ = Right

//SceneView.cpp

void FViewMatrices::Init(const FMinimalInitializer& Initializer);

// first 3 rows of ViewRotationMatrix
@ibreathebsb
ibreathebsb / outline.txt
Created March 3, 2025 03:14
Unreal outlined text material
Begin Object Class=/Script/UnrealEd.MaterialGraphNode_Root Name="MaterialGraphNode_Root_0" ExportPath="/Script/UnrealEd.MaterialGraphNode_Root'/Engine/Transient.M_Text2:MaterialGraph_0.MaterialGraphNode_Root_0'"
Material="/Script/UnrealEd.PreviewMaterial'/Engine/Transient.M_Text2'"
NodePosX=1392
NodePosY=-944
NodeGuid=0CB8AE394F5AB71F5CD07E978E95DA32
CustomProperties Pin (PinId=44BE94B442E53906CB0A20A5DB4455EF,PinName="Base Color",PinType.PinCategory="materialinput",PinType.PinSubCategory="5",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
CustomProperties Pin (PinId=682922C94E24
@ibreathebsb
ibreathebsb / unreal wold position uv node.txt
Created February 26, 2025 10:57
unreal custom node to compute uv
Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_19" ExportPath="/Script/UnrealEd.MaterialGraphNode'/Engine/Transient.PreviewMaterial_0:MaterialGraph_0.MaterialGraphNode_19'"
Begin Object Class=/Script/Engine.MaterialExpressionCustom Name="MaterialExpressionCustom_0" ExportPath="/Script/Engine.MaterialExpressionCustom'/Engine/Transient.PreviewMaterial_0:MaterialGraph_0.MaterialGraphNode_19.MaterialExpressionCustom_0'"
End Object
Begin Object Name="MaterialExpressionCustom_0" ExportPath="/Script/Engine.MaterialExpressionCustom'/Engine/Transient.PreviewMaterial_0:MaterialGraph_0.MaterialGraphNode_19.MaterialExpressionCustom_0'"
Code="\r\nfloat4 NDCPosition = LWCMultiply(MakeLWCVector4(LWCWorldPosition, 1.0f), ResolvedView.WorldToClip);\r\nNDCPosition.xy /= NDCPosition.w;\r\nfloat2 uv = NDCPosition.xy * float2(0.5f, -0.5f) + 0.5f;\r\nreturn uv;\r\n"
OutputType=CMOT_Float2
Description="ComputeUV"
Inputs(0)=(InputName="WorldPosition",Input=(Expression="
// Vertex shader source code
const vertexShaderSource = `#version 300 es
in vec4 position;
in vec2 texCoord;
out vec2 vTexCoord;
void main() {
gl_Position = position;
vTexCoord = texCoord;
}`;
@ibreathebsb
ibreathebsb / Build Protobuf for Unreal Engine 5 on Windows.md
Last active September 4, 2025 04:08
Build Protobuf for Unreal Engine 5 C++ 20 on Windows
@ibreathebsb
ibreathebsb / .ideavimrc
Last active September 24, 2024 08:19
.ideavimrc
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
" the same commands as the original .vimrc configuration.
" You can find a list of commands here: https://jb.gg/h38q75
" Find more examples here: https://jb.gg/share-ideavimrc
""" Map leader to space ---------------------
let mapleader=" "
"" -- Suggested options --
@ibreathebsb
ibreathebsb / imgp.cpp
Created February 6, 2022 05:42
The imgp file loader
#include<iostream>
#include <fstream>
#include <map>
#include<vector>
#include <stb_image.h>
#include <stb_image_write.h>
#define IMGP_SIZE 1024 * 1024
@ibreathebsb
ibreathebsb / vimrc.txt
Last active September 19, 2021 11:02
.vimrc
set path+=**
set relativenumber
set nu
set hidden
set nowrap
set smartindent
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set incsearch