Skip to content

Instantly share code, notes, and snippets.

@ikupenov
ikupenov / recover-start-menu.ps
Created October 27, 2025 22:28
Recovers apps in Windows start menu
# Define Start Menu folder and create a dedicated subfolder
$startMenu = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs"
$customFolder = Join-Path $startMenu "Recovered From Installed Apps"
if (-not (Test-Path $customFolder)) {
New-Item -ItemType Directory -Path $customFolder | Out-Null
}
# Get all registered apps (same list as Settings > Installed apps)
$apps = Get-StartApps
@ikupenov
ikupenov / base.ts
Created November 10, 2024 09:58
Drizzle RLS DB with Policies
// schema/entities/base.ts
export const getBaseEntityProps = () => ({
id: uuid("id")
.default(sql`gen_random_uuid()`)
.primaryKey(),
createdAt: timestamp("created_at", { precision: 3 }).notNull().defaultNow(),
});
export const getOwnedBaseEntityProps = () => ({
@ikupenov
ikupenov / db-client.ts
Created February 29, 2024 18:40
Intercepting Drizzle db calls
import { and, type DBQueryConfig, eq, type SQLWrapper } from "drizzle-orm";
import { drizzle } from "drizzle-orm/postgres-js";
import postgres, { type Sql } from "postgres";
import { type AnyArgs } from "@/common";
import {
type DbClient,
type DbTable,
type DeleteArgs,