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
| // Assumes a parts field in your messages table which holds the parts array of your persisted ui messages. | |
| function transformToolInvocation(part: any): any { | |
| if (part.type !== 'tool-invocation' || !part.toolInvocation) { | |
| return part; | |
| } | |
| const { toolInvocation } = part; | |
| const { args, result, state, toolName, toolCallId, step, ...otherProps } = toolInvocation; |
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
| /** | |
| * A storage class that will remove the oldest items when the storage size is exceeded. | |
| */ | |
| export class RollingStorage implements Storage { | |
| private baseKey: string; | |
| private maxSize: number; | |
| private storage: Storage; | |
| /** | |
| * @param baseKey Base key to use for storage. Will be prefixed to all keys. |
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
| // ==UserScript== | |
| // @name Student Portal Bullshit Toggler | |
| // @author Andrew Prifer | |
| // @description Lets you toggle the useless fixed boxes in the top row of the student portal. After installing, you will see a new button in the menu bar. | |
| // @version 1.0 | |
| // @run-at document-end | |
| // @match https://nestor.rug.nl/webapps/portal/execute/tabs/tabAction?tab_tab_group_id=_700_1 | |
| // ==/UserScript== | |
| function insertAfter(newNode, referenceNode) { |