Skip to content

Instantly share code, notes, and snippets.

@Piket95
Piket95 / deleteScript.ps1
Last active January 12, 2024 10:28
Powershell Script - Delete all files in the directory where the script is in that are older than 30 days
$items = Get-ChildItem ./ -Recurse
# check if every item found in the directory where this script is currently in is older than 30 days and delete them.
# Also exclude this script from results.
$removedItems = 0
$items.ForEach({
if( ($_.LastWriteTime -lt (Get-Date).AddDays(-30)) -and ($_.FullName -ne $PSCommandPath) ) {
@Piket95
Piket95 / pom-moe-json-import.js
Last active November 11, 2023 05:17
Script to import the exported data to pom.moe
/* Sources:
- https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/storage/indexeddb
- https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB?retiredLocale=de#adding_retrieving_and_removing_data
*/
var fileInput = document.createElement('input');
fileInput.type = 'file';
fileInput.addEventListener('change', (e) => {
const reader = new FileReader();
@Piket95
Piket95 / custom-amro.omp.json
Last active November 8, 2023 15:36
A customized oh-my-posh theme for windows terminal - inspired and little customized from the amro theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"type": "os",
"style": "plain",
"foreground": "#26C6DA",