This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |