This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 | |
#include <stdio.h> | |
#define CONCAT(A, B) _CONCAT(A, B) | |
#define _CONCAT(A, B) A##B | |
#define TOSTRING(...) _TOSTRING(__VA_ARGS__) | |
#define _TOSTRING(...) #__VA_ARGS__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define CONCAT(A, B) _CONCAT(A, B) | |
#define _CONCAT(A, B) A##B | |
#define TOSTRING(...) _TOSTRING(__VA_ARGS__) | |
#define _TOSTRING(...) #__VA_ARGS__ | |
#ifdef SECTION_DEFINITIONS | |
#define _section_declaration_definition(SECTION) section_definition(SECTION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env \ | |
[ -n "${PATHEXT}" ] && ext='.exe'; \ | |
bin="$(dirname $0)/$(basename ${0%.*})$ext"; \ | |
c++ -std=c++14 -Werror -o $bin $0 \ | |
&& $bin "$@"; \ | |
status=$?; \ | |
rm $bin; \ | |
exit $status | |
#include <cstdio> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
template<typename T> | |
const char* typenameof() { | |
#if defined(__clang__) | |
enum { header = sizeof("const char *typenameof() [T = ")-1 }; | |
enum { footer = sizeof("]")-1 }; | |
static char buffer[sizeof(__PRETTY_FUNCTION__)-(header+footer)] {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env | |
CMDLINE="$0 $@" | |
#------------------------------------------------------------------------------- | |
function usage { | |
echo "Usage:" | |
echo "" | |
echo " sh $0 [options] <sources> [-- ...]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Swap<T>(ref T a, ref T b) => (a,b)=(b,a); | |
public static void Sort<T>(ref T a, ref T b, ref T c, Comparison<T> comparison) | |
{ | |
if (comparison(a, b) > 0) Swap(ref a, ref b); | |
if (comparison(a, c) > 0) Swap(ref a, ref c); | |
if (comparison(b, c) > 0) Swap(ref b, ref c); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
public static class LocalPackageConverter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
using UnityEditor.Animations; | |
using System.IO; | |
public class CreateBlendTreeAsset | |
{ | |
[MenuItem("Assets/Create/Animation Blend Tree", priority = 402)] | |
private static void CreateBlendTree() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glm | |
import macros | |
import sets | |
import strformat | |
import strutils | |
import tables | |
macro shader*(n: typed) = | |
n.expectKind(nnkStmtList) | |
let astFile = n.lineInfoObj.filename & ".ast" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn TypeIndexGenerator(comptime TIndex: type) type { | |
const index_info = @typeInfo(TIndex); | |
const TInt = switch (index_info) { | |
.Int => TIndex, | |
.Enum => |t| if (t.is_exhaustive) | |
@compileError("TIndex enum must be non-exhaustive") | |
else | |
t.tag_type, |