Skip to content

Instantly share code, notes, and snippets.

View brokenthorn's full-sized avatar
🏠
Working from home

Paul-Sebastian Manole brokenthorn

🏠
Working from home
View GitHub Profile
@brokenthorn
brokenthorn / delete_node_modules_folders_recursively.ps1
Last active November 15, 2024 13:26
Delete all node_modules folders recursively from current folder (or any other folder if you change the folder name)
# Recursively search for directories named "node_modules"
Get-ChildItem -Recurse -Directory -Filter "node_modules" | ForEach-Object {
# Check if the directory name is exactly "node_modules"
if ($_.Name -eq "node_modules" -and $_.FullName -notmatch "node_modules.*\\node_modules") {
# Output the path of the directory being deleted
Write-Output "Deleting: $($_.FullName)"
# Use the 'rd' command via cmd.exe to delete the directory quietly and efficiently
# /s: Removes all files and subdirectories
# /q: Suppresses confirmation prompts
cmd.exe /c "rd /s /q `"$($_.FullName)`""
@brokenthorn
brokenthorn / effect-clearAllLoggers.ts
Last active February 11, 2025 19:54
Effect: Clear all Loggers
import { Effect, FiberRef, HashSet, Layer } from "effect";
/**
* A Layer that clears all existing `Logger`s.
*
* @example
* import { NodeRuntime } from "@effect/platform-node"
* import { Effect, FiberRef, HashSet, Layer, Logger } from "effect"
*
* const MainLayer = Logger.json.pipe(Layer.provide(ClearAllLoggersLayer))