Skip to content

Instantly share code, notes, and snippets.

@codemonkey-uk
codemonkey-uk / parallel_for.h
Last active January 18, 2021 20:33
quickly thrown together parallel_for.h
#pragma once
#include <thread>
#include <mutex>
#include <algorithm>
//
// my sketchy parallel_for
// use:
//
@codemonkey-uk
codemonkey-uk / astar.h
Last active December 30, 2021 13:59
The C++ header file "astar.h" implements the A* graph search (route finding) algorithm using a C++ function template. The interface is written in an STL like style.
// -------------------------------------------------------------------------
// Filename: astar.h
// Version: 3
// Purpose: Provide template for a* algorithm
// (c) T.Frogley 1999-2021
// Stable and used in many projects 2003-2021+
// Updated: 2021 to better support behaviour controls, & unordered_set
// -------------------------------------------------------------------------
#ifndef ASTAR_H
@codemonkey-uk
codemonkey-uk / LODcheck.sh
Last active January 13, 2022 12:02
Find source of "Inconsistent LOD naming (_LOD1 found but no _LOD0)." messages in a large Unity project.
#!/bin/bash
for i in $(seq 0 9)
do
let j=i+1
echo "Looking for LOD$j where no LOD$i exists."
diff <(find . | grep _LOD$i | grep -v meta$ | sed -e "s/LOD$i/LOD-/g" | sort) <(find . | grep _LOD$j | grep -v meta$ | sed -e "s/LOD$j/LOD-/g" | sort) | grep ">"
done