Skip to content

Instantly share code, notes, and snippets.

View namandixit's full-sized avatar
➡️
Guided by PointeSEGMENTATION FAULT

Naman Dixit namandixit

➡️
Guided by PointeSEGMENTATION FAULT
View GitHub Profile
@namandixit
namandixit / Object.h
Created April 28, 2025 23:22 — forked from CodaFi/Object.h
The headers of the oldest version of the Objective-C runtime I could still find. Extracted from an old NeXT image.
#ident "@(#) Object.h, Rev 2.10, 96/08/02"
//
// Copyright (c) 1995-1996, Sun Microsystems, Inc.
// portions (c) Copyright 1988, 1989 NeXT, Inc.
// All rights reserved.
#ifndef _OBJC_OBJECT_H_
#define _OBJC_OBJECT_H_
#import <objc/objc.h>
@namandixit
namandixit / hyperc.h
Last active March 15, 2025 15:06
A jugaadu C23 parser
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: BSD Zero Clause License
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html)
*/
/*
* This is an single-header zero-dependency easily-embeddable C23 parser and associated pretty-printer.
*
@namandixit
namandixit / build.h
Last active March 11, 2025 03:05
Build System Facilitator in C (Ideal for Unity Builds)
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: BSD Zero Clause License
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html)
*/
/* Example Commands to compile a build.c that includes this file:
* * clang --std=c23 -Iassets\code\ -Iprovisions\sources -ferror-limit=500 build.c -o build.exe -Lprovisions\binaries\win64 -lSDL3
* * cl /TC /std:clatest /Iassets\code\ /Iprovisions\sources build.c /Febuild.exe /LIBPATH:provisions\binaries\win64 SDL3.lib
@namandixit
namandixit / cmd.md
Last active December 16, 2024 05:00
Commands for getting the absolute paths from relative paths

Since SDL is not going to add the feature of converting relative paths to absolute paths, here I will document the commands for each platform to do so manually using the SDL_Process API.

If the relative path is stored in variable called relative_path, the run:

  1. Windows:
    txtfmtAppendF(&tf, "cmd /C for %%i in (\"%s\") do @echo %%~fi", relative_path)
@namandixit
namandixit / std.h
Last active April 8, 2025 11:55
Header Prime: The first header everyone should include in their C project (if they are smart, that is)
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: BSD Zero Clause License
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html)
*/
#if !defined(STD_H_INCLUDE_GUARD)
/* Compiler **************************************************************************/
@namandixit
namandixit / maths.cpp
Created October 30, 2024 04:40 — forked from nakst/maths.cpp
// NOTE Compile without fast math flags.
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
@namandixit
namandixit / d3d12.cpp
Created October 8, 2024 04:01
Nimajjana's old partially-written D3D12 renderer, for future reference (programmed by following this tutorial: https://www.3dgep.com/learning-directx-12-1/
/*
* Creator: Naman Dixit
* Notice: © Copyright 2023 Naman Dixit
*/
pragma_clang("clang diagnostic push")
pragma_clang("clang diagnostic ignored \"-Wnonportable-system-include-path\"")
pragma_clang("clang diagnostic ignored \"-Wmicrosoft-enum-value\"")
pragma_clang("clang diagnostic ignored \"-Wreserved-identifier\"")
pragma_clang("clang diagnostic ignored \"-Wnon-virtual-dtor\"")
@namandixit
namandixit / hid_keyboard.xmacro.h
Created October 8, 2024 03:39
HID Keyboard Keys
/*
* The values in this enumeration are based on the HID Usage Tables for Universal Serial Bus (USB):
* https://usb.org/sites/default/files/hut1_4.pdf (Keyboard/Keypad page 0x07)
*/
/* Enum Usage ID String */
KEYBOARD_HID_USAGE_ENTRY( RESERVED, 0, "Reserved(0)" )
KEYBOARD_HID_USAGE_ENTRY( ERROR_ROLL_OVER, 1, "ErrorRollOver" )
KEYBOARD_HID_USAGE_ENTRY( POST_FAIL, 2, "PostFail" )
@namandixit
namandixit / templates.hpp
Created October 8, 2024 02:38
Because C++ maybe be influenza, but STL is cancer
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: MIT No Attribution
* SPDX: MIT-0 (https://spdx.org/licenses/MIT-0.html)
*/
#pragma once
template<typename T>

This document provides community guidelines for a safe, respectful, productive, and collaborative place for any person who is willing to contribute to the Opal community. It applies to all “collaborative space”, which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.).

  • Participants will be tolerant of opposing views.
  • Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
  • When interpreting the words and actions of others, participants should always