Skip to content

Instantly share code, notes, and snippets.

View MrSmith33's full-sized avatar

Andrey Penechko MrSmith33

View GitHub Profile
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
@ocornut
ocornut / (Archived) imgui_memory_editor.h
Last active March 5, 2026 13:43
Mini memory editor for dear imgui (to embed in your game/tools)
// Mini memory editor for Dear ImGui (to embed in your game/tools)
// Animated GIF: https://twitter.com/ocornut/status/894242704317530112
// THE MEMORY EDITOR CODE HAS MOVED TO GIT:
// https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor
// Click "Revisions" on the Gist to see old version.
@dragon788
dragon788 / README.md
Last active April 29, 2025 07:28 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@PetarKirov
PetarKirov / build.sh
Created November 8, 2015 23:36
C++ <-> D non-virtual member function calls
# Build C++ static library:
g++ -c cpp_class.cpp -o cpp_class.o
ar rcs libcpp_class.a cpp_class.o
# Build D static library:
dmd -lib d_class.d
# Build C++ program:
g++ cpp_main.cpp cpp_class.cpp d_class.a -L/usr/lib/x86_64-linux-gnu/ -lphobos2 -o cpp_main
@williewillus
williewillus / Primer.md
Last active February 19, 2026 20:34
1.8 rendering primer

1.8 Rendering Primer by williewillus (formatted to markdown by gigaherz)

Note: This primer assumes you are using MinecraftForge 1.8.9 build 1670 or above. Correctness not guaranteed otherwise. Note 2: This primer is for 1.8.x. Changes in 1.9 are on another gist: https://gist.github.com/williewillus/e37edde85dc78d2e138c

This guide is intended for those with a clear knowledge of general modding and want a quick up to speed on how new things work. If you are confused, please hop on IRC and ask for help!

Blocks and Items

  • 1.7: EVERY BLOCK SHAPE EVER was hardcoded into RenderBlocks or your ISBRH. Oh God, just look at that class. Actually don’t, if you value your sanity.
@alirobe
alirobe / reclaimWindows10.ps1
Last active August 27, 2026 19:55
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@S-V
S-V / VoxelGridIterator.h
Last active September 10, 2016 14:51
Uniform Grid Ray Casting
/**
* An iterator for a cubic grid of voxels.
*
* The iterator traverses all voxels along a specified direction starting from
* a given position.
*/
mxBIBREF(
"Ray casting technique described in paper:"
"A Fast Voxel Traversal Algorithm for Ray Tracing - John Amanatides, Andrew Woo [1987]"
"http://www.cse.yorku.ca/~amana/research/grid.pdf"
@msimpson
msimpson / !wasmllvm.md
Last active December 2, 2020 18:29 — forked from yurydelendik/!wasmllvm.md
Using WebAssembly in LLVM on Windows

Using WebAssembly in LLVM on Windows

Forewarning: this can be a bit painful and may not work as expected. I've already had issues with even including stdlib through clang.

Installing Dependencies

GIT

Make sure you have git installed and properly configured before continuing. This is trivial on Windows these days (https://git-scm.com/download/win) but is required to pull down Binaryen and Wabt.

Make sure to add the binary to your PATH variable in Windows.

#include <windows.h>
#include <GL/gl.h>
#include <stdio.h>
#pragma comment(lib, "opengl32.lib")
void glview()
{
HWND hWnd = CreateWindow(L"ListBox", L"Title", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
HDC hDC = GetDC(hWnd);
@zeux
zeux / edge-encode.cpp
Last active December 8, 2018 06:25
8-bit (unsigned) floating point encoding that is designed to be very efficient to decode on DX9/GLES2 class GPUs
// Can be used to efficiently encode floating point values from a limited range ([0..65k]) into a byte
// edgeDecode is optimized for GPUs (native exp2)
// edgeEncode1 is optimized for GPUs (native log2)
// edgeEncode2 is optimized for CPUs but is an approximation
// edgeEncode3 is optimized for CPUs
float edgeDecode(int e)
{
return exp2f(float(e) * (1 / 16.f)) - 1;
}