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; |
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
/// | |
/// Adds logging to all functions in a JS object. | |
/// | |
/// Backbone usage example: | |
/// return Backbone.View.extend({ ... }); | |
/// becomes: | |
/// return Backbone.View.extend(addLogs({ ... })); | |
/// and all method invocations are now logged to the console. | |
/// | |
function addLogs(obj) { |
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
cd "$(dirname "${BASH_SOURCE[0]}")" |