Skip to content

Instantly share code, notes, and snippets.

View Aidurber's full-sized avatar
👁️

Andrew Aidurber

👁️
View GitHub Profile
@Aidurber
Aidurber / text-search-collection.ts
Last active June 19, 2019 09:06
Type safe text search of collection
/**
* Perform text search on collection of object for multiple keys
*
* @export
* @template T
* @param {T[]} values - The collection
* @param {Array<keyof T>} keys - An array of properties on the object (array of strings)
* @param {string} term - Search term
* @returns
*/
@Aidurber
Aidurber / cleanup.sh
Last active September 29, 2022 13:14
A handy script to clean up a mac thanks to - Gant Laborde's article: https://medium.freecodecamp.org/how-to-free-up-space-on-your-developer-mac-f542f66ddfb
# Cleanup old node_modules
echo "Cleaning node_modules in projects older than 30 days"
find . -name "node_modules" -type d -mtime +30 | xargs rm -rf
echo "Done cleaning node_modules"
# Clean up homebrew
echo "Clean homebrew"
brew update && brew upgrade && brew cleanup
echo "Done cleaning homebrew"
@Aidurber
Aidurber / search.cs
Created May 10, 2015 08:36
High Performance String Searching C#
var matches = list.AsParallel().Where(s => s.Contains(searchTerm)).ToList();