Snippets

This page features a diverse collection of my favorite code snippets from around the web.


Delete All Docker images

Terminal window
docker rmi $(docker images -q)

Delete All Dangling images

Terminal window
docker rmi $(docker images -f "dangling=true" -q)

Count number of lines in a git repository

Terminal window
git ls-files | xargs wc -l

Famous Shadcn cn function

lib/utils.ts
// pnpm add clsx tailwind-merge
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}

Let's connect

If you want to get in touch with me about something or just to say hi, reach out on social media or send me an email.