Skip to content

Instantly share code, notes, and snippets.

View Sighyu's full-sized avatar
🎯
Focusing

Sighyu Sighyu

🎯
Focusing
  • London
  • 23:44 (UTC)
View GitHub Profile
# I added a 'memo' dictionary as an optional argument to store previously computed results.
def levenshtein_distance_memo(s1, s2, memo=None):
# I initialized the memo dictionary on the first call so the cache is carried through recursion.
if memo is None:
memo = {}
# I created a unique key based on the current state (lengths of strings).
# I used lengths as keys instead of the strings themselves.
key = (len(s1), len(s2))
@Sighyu
Sighyu / Example.cs
Created March 3, 2026 06:35
MakeItAQuoteAPI
[Command("quote")]
[Description("Generate a Make it a Quote image for the supplied snowflake.")]
[InteractionInstallType(DiscordApplicationIntegrationType.UserInstall, DiscordApplicationIntegrationType.GuildInstall)]
[InteractionAllowedContexts(DiscordInteractionContextType.Guild, DiscordInteractionContextType.BotDM, DiscordInteractionContextType.PrivateChannel)]
public static async ValueTask QuoteAsync(
SlashCommandContext ctx,
[Parameter("user_id"), Description("Target user snowflake (ID)")] string userId,
[Parameter("text"), Description("Text for the quote")] string text,
[Parameter("color"), Description("Use colored background")] bool? color = null,
[Parameter("beta"), Description("Use the beta renderer")] bool? beta = null)
@Sighyu
Sighyu / Favorite_gifs.js
Created February 16, 2026 01:23
export discord favourite gifs (requires vencord or any other vencord forks)
/*
Export your favourite gifs
Vencord is required or any fork of vencord
paste into console using ctrl+shift+i
*/
(() => {
// 1. Find the module that manages user settings (including fav gifs)
const FrecencyUserSettings = Vencord.Webpack.find(m => m.ProtoClass?.typeName?.endsWith(".FrecencyUserSettings"));
if (!FrecencyUserSettings) {
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Security.Cryptography;