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 / registry.hpp
Created November 14, 2018 22:15
EnTT Resource Registry
#ifndef ENTT_RESOURCE_REGISTRY_HPP
#define ENTT_RESOURCE_REGISTRY_HPP
#include <entt/resource/cache.hpp>
#include <entt/core/family.hpp>
#include <string>
#include <vector>
namespace entt
@ArnCarveris
ArnCarveris / exporter.hpp
Created November 14, 2018 22:20
EnTT Entity Exporter/Importer
#ifndef ENTT_ENTITY_EXPORTER_HPP
#define ENTT_ENTITY_EXPORTER_HPP
#include <array>
#include <cstddef>
#include <utility>
#include <cassert>
#include <iterator>
#include <type_traits>
@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
{
@ArnCarveris
ArnCarveris / flecs_backup.c
Last active September 30, 2019 09:13
flecs sandbox draft
#include "flecs_backup.h"
typedef uint32_t ecs_type_index_t;
bool ecs_type_next_index(ecs_type_t type, ecs_entity_t mask, ecs_type_index_t* index)
{
ecs_entity_t *array = (ecs_entity_t *)ecs_vector_first(type);
ecs_type_index_t count = ecs_vector_count(type);
local ecs = require("flecs"):init()
local ID = ecs.ID
local SYSTEM = ecs.SYSTEM
ecs:import("flecs_components_input")
ecs:import("flecs_components_graphics")
ecs:import("flecs_components_geometry")
ecs:import("flecs_components_transform")
ecs:new_component{"setup"}
//@Innokentiy-Alaytsev - https://github.com/Manu343726/ctti
//@Innokentiy-Alaytsev - There is an example of constexpr thing @dBagrat posted recently
template< typename T >
static constexpr auto TypeName()
{
#if defined( _MSC_VER )
constexpr std::string_view funcName = __FUNCSIG__;
#else
constexpr std::string_view funcName = __PRETTY_FUNCTION__;
@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
command script import -c test_item.py
command script import -c test_list.py
command script import -c nlohmann_json.py

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);
#include <cassert>
#include <iostream>
#include <functional>
#include <memory>
#include <type_traits>
#include <typeinfo>
#include <typeindex>
#include <utility>
#include <unordered_map>