Skip to content

Instantly share code, notes, and snippets.

View The-LukeZ's full-sized avatar
🤌
Busy

LukeZ The-LukeZ

🤌
Busy
View GitHub Profile
@The-LukeZ
The-LukeZ / how-to.md
Last active August 11, 2026 19:03
Fixing a Broken Discord Taskbar Shortcut (and Customizing Its Icon)

Fixing a Broken Discord Taskbar Shortcut (and Customizing Its Icon)

Discord has a file called Update.exe which launches the latest version of the Discord client, or updates it if a new version is available. If you're a regular Windows user, you've probably pinned a shortcut to Update.exe on your taskbar for quick access.

The problem: this shortcut breaks more easily than you'd expect. Every time Discord updates, the version folder it points to changes, the icon can vanish, and the taskbar pin can end up pointing at nothing. This guide covers how to fix that, and how to customize the icon while you're at it.

Why the Shortcut Breaks

Discord installs updates into versioned folders like app-1.0.1211, app-1.0.1212, and so on. If you link directly to DiscordPTB.exe inside one of these folders, the link stops working the moment Discord updates and that folder is replaced.

@The-LukeZ
The-LukeZ / ImageWrapper.astro
Last active July 20, 2026 15:00
Astro Starlight Image Lightbox Integration
---
// I have a component to wrap images for better styling as well - do what you want.
interface Props {
size?: "sm" | "md" | "lg" | "xl" | "full";
class?: string;
}
const { size = "md", class: customClasses = "" } = Astro.props; // Default width for optimization
const sizeClasses = (_size: Props["size"] = "md") =>
@The-LukeZ
The-LukeZ / index.ts
Created May 19, 2026 22:44
shadcn-svelte tabs with floating pill
import Root from "./tabs.svelte";
import Content from "./tabs-content.svelte";
import List, { tabsListVariants, type TabsListVariant } from "./tabs-list.svelte";
import Trigger from "./tabs-trigger.svelte";
export {
Root,
Content,
List,
Trigger,
### Keybase proof
I hereby claim:
* I am The-LukeZ on github.
* I am thelukez (https://keybase.io/thelukez) on keybase.
* I have a public key whose fingerprint is BAE2 9984 815D E579 5241 4137 0FEA EA53 82B2 C3BD
To claim this, I am signing this object:
@The-LukeZ
The-LukeZ / upsideDown.ts
Created April 1, 2026 07:12
Upside down text
const FLIP_MAP: Record<string, string> = {
a: "ɐ",
b: "q",
c: "ɔ",
d: "p",
e: "ǝ",
f: "ɟ",
g: "ƃ",
h: "ɥ",
i: "ᴉ",
@The-LukeZ
The-LukeZ / bitfield.svelte.ts
Created February 27, 2026 09:37
Reactive Svelte 5 Bitfield class
/**
* A reactive implementation of a Bitfield.
*/
export class SvelteBitfield {
private _bits = $state<bigint>(BigInt(0));
constructor(bits: bigint | number | string | boolean = BigInt(0)) {
this._bits = BigInt(bits);
}
@The-LukeZ
The-LukeZ / safeParseInt.js
Created January 22, 2026 13:54
Safe parse function for typescript
/**
* Attempts to parse a string as an integer with validation and clamping.
*
* @param {unknown} str - The string to parse as an integer
* @param {number} defaultValue - The value to return if parsing fails or validation fails
* @param {string} [min=1] - The minimum allowed value (inclusive), defaults to 1
* @param {number} [max] - The maximum allowed value (inclusive)
* @returns {number} The parsed integer clamped to the range [min, max], or the default value if parsing fails
*
* @example
@The-LukeZ
The-LukeZ / README.md
Last active October 30, 2025 10:46
Typesafe NodeCache

NodeCache already has Typescript support, however, you always need to pass your type when using cache.get() for example.

Below you can find an example of a cache factory which provides a full typesafe interface while only providing the type once.

How it works? The type interface for the NodeCache already has dynamic types and I only wrapped it in a wrapper-function and enhanced the JSDoc comments.

@The-LukeZ
The-LukeZ / discord-markup-parser.ts
Last active August 24, 2025 20:38
Discord Markup Parser for better markdown parsing
/** MarkdownParser.ts
*
* Tokenization-first markdown -> HTML implementation
*
* Features:
* - Bold: **bold**
* - Italic: *italic* or _italic_
* - Underline: __underline__
* - Subtext: lines starting with "-# "
* - Strikethrough: ~~strike~~