Public vals
17
mattx
parse_cookies
Script
parse_cookies Parses Cookie headers into objects. jar : Value of the Cookie header decoder : Function to run on all cookie names and values. This is to get around character limitations (see RFC 6265 ). There is no formal standard, but as most sites prefer URL encoding, it is the default. x => x can be used as a way to disable decoding.
0
mattx
remind_new_open_llm
Script
remind_new_open_llm This val sends you an email whenever a new LLM appears in the top 10 LLMs on the Open LLM Leaderboard . Use an interval of at least 12 hours as the top 10 doesn't change that frequently.
You can adjust the array slice to change how many places on the leaderboard to monitor, or remove it entirely to fill up your mailbox. Bugs If a model unfairly gets to the top 10 and then gets flagged for it, you'll get a reminder for an LLM that's in most cases not new at all. Hopefully this doesn't happen too often.
0
mattx
gsheet_call
Script
gsheet_call Wrapper around Google Sheets API v4. Parameters service_account: JSON string containing Google Service Account key sheet_id: Google Sheet ID method: HTTP method to use action: Full URL with https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/ removed data: HTTP request body Requirements a Google Cloud service account the Google Sheets API v4 enabled in your Google Cloud project the spreadsheet ID (provide it in the sheet_id parameter) Instructions Share the spreadsheet with the service account Make a JSON key for the service account, then set it as a secret. Use the secret for the service_account parameter. Figure out the action you want to perform. You will need to provide everything that comes after {spreadsheetId}/ as the action parameter. For example: values/A1:C1:append?valueInputOption=RAW Figure out the request body. For example: {values: [["foo", "bar", "baz"]]}
5
mattx
verify_discord_signature
Script
verify_discord_signature Verify HTTP signatures coming from Discord. public_key should be the Ed25519 public key from Discord, as a hex string body should be the request body as a string. If you have a JSON object as the request body, use JSON.stringify. signature should be the X-Signature-Ed25519 header timestamp should be the X-Signature-Timestamp header
You must return a 401 error and return early if this function returns false, otherwise you will pretty quickly get a big scary warning from Discord that your endpoint has been removed. Note that you'll only be able to add one once you've integrated this correctly. As this function only deals with strings, it doesn't matter whether you use an Express or web endpoint.
1
mattx
register_discord_commands
Script
register_discord_commands Registers slash commands for your Discord bot, globally or in one guild. Note that this overwrites old commands. app_id: Your bot's application ID as a string guild_id: Provide a guild ID as a string to apply the commands only in one guild, or use null to apply globally. Note that applying commands globally takes a while on Discord's end. token: Your bot's token. commands: An array of command objects to register. For a basic command with no arguments, only name and description are needed.
1