Skip to content

Instantly share code, notes, and snippets.

View BurntNail's full-sized avatar

Jack Maguire BurntNail

View GitHub Profile

Keybase proof

I hereby claim:

  • I am burntnail on github.
  • I am burntnail (https://keybase.io/burntnail) on keybase.
  • I have a public key ASA5XVQnbE3TONXSmIrASxReJFPkge5JGgaYdRCIQcEqCwo

To claim this, I am signing this object:

@BurntNail
BurntNail / main.rs
Last active January 13, 2024 14:15
An allocator for all sizes & types, backed by UnsafeCell<[u8; 1_000_000_000]>
use std::alloc::{GlobalAlloc, Layout};
use std::cell::UnsafeCell;
use std::sync::atomic::{AtomicBool, Ordering};
mod printing {
use super::get_thread_id;
use std::alloc::Layout;
const STDOUT_FILENO: i32 = 1;
@BurntNail
BurntNail / main.rs
Created January 10, 2024 22:39
Serialising Rust structs to and from binary directly
use std::{
alloc::Layout,
fs::File,
io::{Read, Write},
};
#[derive(Debug, Copy, Clone)]
struct ExampleData {
a: u8,
b: u64,
@BurntNail
BurntNail / main.rs
Created January 10, 2024 22:36
Allocator that only deals with 4-4 layouts, and only has 64 slots for concurrent allocations
use std::sync::atomic::{AtomicBool, Ordering::SeqCst};
use std::cell::UnsafeCell;
use std::alloc::{GlobalAlloc, Layout};
pub struct FourAllocator {
is_allocating: AtomicBool,
tracker: UnsafeCell<usize>,
spaces: UnsafeCell<[u8; usize::BITS as usize * 4]>
}
@BurntNail
BurntNail / TrueTaper.py
Created January 13, 2021 11:22
Blender Addon to truly taper a face.
import bpy
from bpy.utils import register_class, unregister_class
from bpy.props import FloatProperty
class TrueTaperOperator (bpy.types.Operator):
bl_idname = "ops.true_taper"
bl_label = "True Taper a face"
bl_options = {'REGISTER', 'UNDO'}
thicc: FloatProperty(name="Taper Size", default=0.1)
@BurntNail
BurntNail / align2.py
Created January 6, 2021 08:58
Addon of the align object between other 2 objects script. Mapped to Ctrl-Shift-V
import bpy
from bpy.utils import register_class, unregister_class
class RotateBetweenTwoOperator (bpy.types.Operator):
bl_idname = "ops.align_between_two"
bl_label = "Align Object between 2 other objects."
@classmethod
def poll(cls, context):