Newest

1
let helloFriend = "Hello, " + @rodrigotello.myName;
0
0
1
2
3
function myApi(name) {
return "hi " + name;
}
0
0
1
2
3
4
5
6
7
8
9
10
async function hexToUtf8(hex) {
if (hex.startsWith("0x")) {
hex = hex.slice(2);
}
let str = "";
for (let i = 0; i < hex.length; i += 2) {
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
}
return decodeURIComponent(escape(str));
}
0
0
1
let helloFriend = "Hello, " + @rodrigotello.myName;
0
0
1
2
3
function myApi(name) {
return "hi " + name;
}
0
0
1
2
3
4
let tursoExample = @me.turso().execute({
sql: `select value from kv where key=?`,
args: ["hello"],
});
0
0

Allows Observable notebooks to statically import ES modules as Runtime modules.

See https://observablehq.com/d/1ff60814f0002dd5 for details and examples.

Readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const observable_esm = async (request: Request): Promise<Response> => {
const url = new URL(request.url);
url.protocol = "https";
url.hostname = "esm.sh";
const body = `
import * as module from ${JSON.stringify(url)};
export default function define(runtime, observer) {
const main = runtime.module();
main.variable(observer("__module")).define("__module", () => module);
for(const key of Object.keys(module)) {
const alias = key === "default" ? "__" + key : key;
main.variable(observer(alias)).define(alias, () => module[key]);
}
return main;
}
`;
// Increase caching duration if we have a version specifier.
const maxAge = 60 * 60 * (url.pathname.slice(2).includes("@") ? 24 : 1);
return new Response(body, {
headers: {
"Content-Type": "application/javascript",
"Cache-Control": `public, max-age=${maxAge}`,
},
});
};
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export const warden = () => {
const whatHeDoinUnderThere = @IronFlare.randomPhrase([
"got hemorrhoids",
"playing a rhythm game",
"carrying a League of Legends game, about to close it out, when his bra-less wife brings him a sandwich (not asked for) with chips as he gets a kill bot lane",
"got an itchy leg",
"listening to music",
"whipping some heavy cream",
]);
if (Math.random() > 0.98) {
return `He’s masturbating.`;
}
return `It’s not what it looks like! He’s just ${whatHeDoinUnderThere}!`;
};
0
0
1
2
3
function myApi(name) {
return "hi " + name;
}
0
0
1
2
// set by stevekrouse.store at 2023-09-21T20:22:10.795Z
let username = "stevekrouse";
0
2