rcaldous / deleteEmpty.ps1
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | $LogPath = Read-Host 'Path to delete empty folders' |
2 | Get-ChildItem -LiteralPath $LogPath -Force -Recurse | Where-Object { |
3 | $_.PSIsContainer -and ` |
4 | @(Get-ChildItem -LiteralPath $_.Fullname -Force -Recurse | Where { -not $_.PSIsContainer }).Count -eq 0 } | |
5 | Remove-Item -Recurse |
rcaldous / Enum from String - Kotlin
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | // https://stackoverflow.com/questions/28548015/how-do-i-create-an-enum-from-a-string-in-kotlin |
2 | inline fun <reified T : Enum<T>> valueOf(type: String): T? { |
3 | return try { |
4 | java.lang.Enum.valueOf(T::class.java, type) |
5 | } catch (e: Exception) { |
6 | null |
7 | } |
8 | } |
rcaldous / RecordList Interface for Kotlin
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | interface RecordList { |
2 | fun toRecordList(): MutableList<List<String>> |
3 | fun toMinimalRecordList(): MutableList<List<String>> |
4 | |
5 | val name: String |
6 | val header: List<String> |
7 | val headerMin: List<String> |
8 | } |
rcaldous / Generate Colour Scheme
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | convert image.png -geometry 16x16 -colors 8 -unique-colors -scale 16000% scheme.png |
rcaldous / Create Folders from txt list
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | xargs -d '\n' mkdir -p -- < folder_list.txt |
rcaldous / Clear Bash history
0 polubień
0 forków
1 plików
Ostatnio aktywne
Don't want to be tempted to up arrow?
1 | cat /dev/null > ~/.bash_history && history -c && exit |
rcaldous / Git sub git actions (bulk actions)
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | alias gfs="find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;" |
2 | alias gfp='ls | xargs -P10 -I{} git -C {} pull' |
rcaldous / Zip All sub folders (no compression)
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | for i in */; do zip -r0 "${i%/}.zip" "$i"; done |
rcaldous / docker compose aliases
0 polubień
0 forków
1 plików
Ostatnio aktywne
1 | alias dcpull='docker compose pull' |
2 | alias dcupd='docker compose up -d' |
3 | alias dcdown='docker compose down' |
4 | alias dcuro='docker compose up -d --remove-orphans' |
5 | alias dcure='docker compose up -d --force-recreate' |
Nowsze
Starsze