This file contains hidden or 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
interface ILogger { | |
log(...args: any[]): void | |
error(...args: any[]): void | |
info(...args: any[]): void | |
warn(...args: any[]): void | |
} | |
type Level = 'log' | 'info' | 'warn' | 'error' | |
const getColor = (level: Level) => { | |
switch (level) { |
This file contains hidden or 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
export async function getAllProjectsByStatus(user: UserDto, status: Status) { | |
return getAllProjects(user, { status: status.toUpperCase() as Status }); | |
} | |
type ProjectQuery = { | |
status?: Status; | |
type?: ProjectType; | |
}; | |
export async function getAllProjects( | |
user: UserDto, |
This file contains hidden or 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
/** | |
* 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 | |
*/ |
This file contains hidden or 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
# 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" |
This file contains hidden or 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
var matches = list.AsParallel().Where(s => s.Contains(searchTerm)).ToList(); |