Skip to content

Instantly share code, notes, and snippets.

View ArnCarveris's full-sized avatar
🎯
R&D

Arn ArnCarveris

🎯
R&D
View GitHub Profile
@ArnCarveris
ArnCarveris / dladdr-lambda-test.mm
Created March 19, 2024 12:55 — forked from bdash/dladdr-lambda-test.mm
Test of backtrace and dladdr with C++ lambdas
// c++ -framework Foundation -std=c++14 -o dladdr-lambda-test dladdr-lambda-test.mm
#import <Foundation/Foundation.h>
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
@interface MyObject : NSObject
@end
@ArnCarveris
ArnCarveris / CustomDefines.cs
Created January 30, 2024 10:22 — forked from KevinThielen/CustomDefines.cs
[Unity] Create MenuItems dynamically to add/remove preprocessor macros.
using UnityEngine;
using UnityEditor;
using System.Text;
namespace MyUtil
{
[InitializeOnLoad]
public partial class CustomDefines
{
private const string ScriptPath = "/Util/Editor/MyDefines.cs"; //path including the name of to the (to be) generated File
#include <cassert>
#include <iostream>
#include <functional>
#include <memory>
#include <type_traits>
#include <typeinfo>
#include <typeindex>
#include <utility>
#include <unordered_map>

I think using scopes greatly improves readability. Here's an example of converting a larger section of code. The indenting makes it immediately clear when a scopes begins and ends. Both snippets of code draw the exact same controls.

Before:

EditorGUILayout.BeginVertical("box");
disable = EditorGUILayout.Toggle("Disable Sliders", disable);
indent = EditorGUILayout.IntSlider("Indent Sliders", indent, 1, 4);
@ArnCarveris
ArnCarveris / lldb.txt
Created January 27, 2021 14:00 — forked from hotwatermorning/lldb.txt
Step into std::function with lldb of Xcode
(lldb) settings show target.process.thread.step-avoid-regexp
target.process.thread.step-avoid-regexp (regex) = ^std::
(lldb) settings set target.process.thread.step-avoid-regexp ""
http://stackoverflow.com/questions/19413181/step-into-stl-sources-in-xcode-5
@ArnCarveris
ArnCarveris / NodeGraph.cpp
Created November 18, 2018 01:33 — forked from spacechase0/NodeGraph.cpp
ImGui node graph
#include <any>
#include <cmath>
#include <imgui.h>
#include <imgui_internal.h>
#include "NodeGraph.hpp"
namespace
{