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
#pragma once | |
#include <stddef.h> | |
#include <stdlib.h> | |
#define Vec( T ) struct { \ | |
size_t count; \ | |
T *items; \ | |
} |
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
/* | |
Copyright 2021 Jeremy Burns | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O |
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
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser | |
if (!(Test-Path -Path "$Profile")) {New-Item -ItemType File -Path "$Profile" -Force} | |
Add-Content -Value "Set-PSReadlineOption -BellStyle None" -Path "$Profile" |
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 bash | |
find_files() { | |
ag "$1" | cut -d: -f1 | sort | uniq | |
} | |
do_replace() { | |
echo "Finding files matching orignial string $1" | |
for f in $(find_files "$1"); do | |
echo " -> Replacing string in file $f" |
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
[merge] | |
tool = vs | |
[mergetool "vs"] | |
cmd = /home/XXX/win_merge.sh merge $LOCAL $REMOTE $BASE $MERGED | |
trustExitCode = false | |
[mergetool] | |
keepBackup = false | |
[diff] | |
tool = vs | |
[difftool "vs"] |
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 "fixed32.hpp" | |
#include <cmath> | |
static const int32_t DECIMAL_BITS = 16; | |
const fixed32 fixed32::ZERO = fixed32(0); | |
const fixed32 fixed32::ONE = fixed32(1); | |
const fixed32 fixed32::MINUS_ONE = fixed32(-1); | |
const fixed32 fixed32::TWO = fixed32(2); |
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 isProduction = process.env.NODE_ENV === 'production'; | |
module.exports = { | |
context: __dirname, | |
entry: { | |
styles: ['./sass/main.scss'] | |
}, | |
output: { | |
filename: 'build.css' | |
}, |
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
float3x3 quaternionToRotationMatrix(float4 q) | |
{ | |
return float3x3( | |
1 - 2*q.y*q.y - 2*q.z*q.z , 2*q.x*q.y - 2*q.z*q.w , 2*q.x*q.z + 2*q.y*q.w, | |
2*q.x*q.y + 2*q.z*q.w , 1 - 2*q.x*q.x - 2*q.z*q.z , 2*q.y*q.z - 2*q.x*q.w, | |
2*q.x*q.z - 2*q.y*q.w , 2*q.y*q.z + 2*q.x*q.w , 1 - 2*q.x*q.x - 2*q.y*q.y | |
); | |
} |
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 M = 4294967296; | |
const A = 1664525; | |
const C = 1013904223; | |
// seed is an integer in the range [0, M) | |
const next = seed => (A * seed + C) % M; | |
const value = seed => seed / M; |