Skip to content

Instantly share code, notes, and snippets.

@segevfiner
segevfiner / Refresh-Icons.ps1
Last active November 19, 2021 17:59
Refresh the Windows icon cache
<#
.SYNOPSIS
Refresh the Windows icon cache.
.DESCRIPTION
Refresh the Windows icon cache. Some versions of Windows had the icon cache become corrupted occasionally,
showing the wrong icon for programs. This script will fix it by requesting that it be rebuilt.
.INPUTS
None.
@segevfiner
segevfiner / Refresh-Environment.ps1
Created November 24, 2021 13:56
Refresh the Windows environment variables from the registry
<#
.SYNOPSIS
Refresh the Windows environment variables from the registry.
.DESCRIPTION
Refresh the Windows environment variables from the registry.
.INPUTS
None.
@segevfiner
segevfiner / dumplnk.py
Created December 31, 2021 09:38
Dump an .lnk file
#!/usr/bin/env python3
"""
Dump an .lnk file.
"""
import sys
import argparse
from pprint import pprint
from win32com.shell import shell, shellcon # type: ignore
from win32com.propsys import propsys # type: ignore
@segevfiner
segevfiner / super_motherload_high_dpi_fix.reg
Created February 22, 2023 22:51
Super Motherload High DPI Fix
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Super Motherload\\supermotherloadGL.exe"="~ HIGHDPIAWARE"
"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Super Motherload\\supermotherloadD3D11.exe"="~ HIGHDPIAWARE"
@segevfiner
segevfiner / tiptapVueDevtools.ts
Created May 3, 2023 16:00
Tiptap Vue Devtools
import type { Plugin } from 'vue';
import { setupDevtoolsPlugin } from '@vue/devtools-api';
import { Editor } from '@tiptap/core';
declare const __VUE_PROD_DEVTOOLS__: boolean | undefined;
const STATE_TYPE = 'Tiptap';
interface TiptapVueDevtoolsMarker {
__TIPTAP_VUE_DEVTOOLS_REGISTERED__?: boolean;
@segevfiner
segevfiner / turn-off-home-led.py
Created June 22, 2024 07:57
Turn off Switch Pro Controller Home LED
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "pysdl2",
# "pysdl2-dll",
# ]
# ///
"""
Old versions of SDL2 used to turn on the Switch Pro Controller home LED, which is often
@segevfiner
segevfiner / supabase-install-pldbgapi.sh
Created July 12, 2024 10:47
Install pldbgapi in the local Supabase development PostgresSQL
#!/bin/bash
set -ex
project_id=$(sed -nr 's/project_id[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' supabase/config.toml)
major_version=$(sed -nr 's/major_version[[:space:]]*=[[:space:]]*([[:digit:]]+)/\1/p' supabase/config.toml)
docker exec -i supabase_db_$project_id bash <<EOF
set -x
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh