Sources:
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 interface EasingMethods { | |
in(t: number): number; | |
out(t: number): number; | |
inOut(t: number): number; | |
} | |
interface EasingDef<K extends string = string> extends EasingMethods { | |
readonly name: K; | |
} |
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
(module | |
;; Memory: 1 page = 64 KiB | |
(memory $memory 1) | |
;; Exported error flag (0 = no error, 1 = error) | |
(global $error_flag (mut i32) (i32.const 0)) | |
;; Base64 encoding table | |
(data (i32.const 0) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/") |
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
const _tag: unique symbol = Symbol("Option.#tag"); | |
type _tag = typeof _tag; | |
export interface Some<T> extends Option<T> { | |
readonly [_tag]: "Some"; | |
readonly value: T; | |
} | |
export interface None extends Option<never> { |
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
The MIT License (MIT) | |
Copyright (c) 2025+ Nicholas Berlette (https://github.com/nberlette) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
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
The MIT License (MIT) | |
Copyright (c) 2024-2025 Nicholas Berlette. All rights reserved. | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
Workers AI Playground Prompts
You are a friendly expert software engineer. If the user requests you generate code, assume
they want it written in TypeScript for Deno, and follow these rules to the letter: The code
should avoid using any external dependencies, unless absolutely necessary or specifically
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
<div class="editor"> | |
<n-window id="window1" class="window"> | |
<n-view slot="views"> | |
<n-tab slot="tabs" part="primary">Explorer</n-tab> | |
<n-tab slot="tabs" part="primary">Search</n-tab> | |
<n-tab slot="tabs" part="primary">Extensions</n-tab> | |
<div slot="content" name="panel-0"> | |
<n-view> | |
<n-tab slot="tabs" active>File 1</n-tab> |
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
#[macro_export] | |
macro_rules! impl_wrapper_with_trait { | |
// Match multiple wrapper types with external type and default implementation (no custom tt) | |
( | |
$( | |
$(#[$meta:meta])* | |
$(unsafe)? $($vis:vis,? )? $wrapper:ident$(<$($lifetime:lifetime),+>)?$( : $ty:ty)? => $path:path $(,)? $({ | |
$($body:block)+ | |
})? $(,)? | |
$(,)?)+ |
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
/** | |
* Binds all functions and accessors of an object to a specified 'thisArg'. | |
* | |
* This has proven to be particularly useful in scenarios where you want to | |
* subclass the native `Function` API, and want to be able to call `this` from | |
* within the function body string that you pass to `super()`. This allows you | |
* to effortlessly create a callable object, which can be invoked directly as | |
* a function or also by calling the corresponding method that is aliased by | |
* the super's function body. See the example below for a real-world | |
* demonstration. |