Avatar

mattx

Joined January 11, 2023
Public vals
17
mattx avatar
mattx
gsheet_example
Script
// Appending to a sheet
0
mattx avatar
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 avatar
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 avatar
mattx
scrape_open_llm_leaderboard
Script
scrape_open_llm_leaderboard This uses scrape_gradio_data to scrape the Open LLM Leaderboard and grab the names of all models that are not flagged. Array is ordered by average benchmark accuracy.
0
mattx avatar
mattx
scrape_gradio_data
Script
scrape_gradio_data Scrapes the gradio_config object from Gradio sites/spaces. Most useful when pointed at a gradio site with lots of static data like the Open LLM Leaderboard
0
mattx avatar
mattx
example1
Script
// set by mattx.write_example1 at 2023-06-07T19:10:23.195Z
0
mattx avatar
mattx
write_example1
Script
An interactive, runnable TypeScript val by mattx
0
mattx avatar
mattx
airtable_deno_sample
Script
An interactive, runnable TypeScript val by mattx
0
mattx avatar
mattx
airtable_get_sample
Script
An interactive, runnable TypeScript val by mattx
0
mattx avatar
mattx
faunadb_test
Script
An interactive, runnable TypeScript val by mattx
0
mattx avatar
mattx
gsheet_append_example
Script
An interactive, runnable TypeScript val by mattx
0
mattx avatar
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 avatar
mattx
examplebotendpoint
Express (deprecated)
An interactive, runnable TypeScript val by mattx
0
mattx avatar
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 avatar
mattx
examplebot_commands
Script
An interactive, runnable TypeScript val by mattx
0
mattx avatar
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