tidbytCirclemain.tsx1 match
1export async function tidbytCircle({ size = 7, fill, border }: {
2size?: number;
3fill?: number;
createTidbytWorkoutsImagemain.tsx2 matches
8import Jimp from "npm:jimp@0";
910export async function createTidbytWorkoutsImage(icons: WorkoutIcon[]) {
11const headerUrl = "https://art.pixilart.com/sr2c714c74a22aws3.png";
12const weekdaysUrl = "https://art.pixilart.com/sr22f1df42b42aws3.png";
54});
5556function selectIcon(icon: WorkoutIcon) {
57switch (icon) {
58case "done":
rabbitstreamUtilsmain.tsx5 matches
1import CryptoJS from "npm:crypto-js";
2const cryptoJs = CryptoJS;
3function _kv(a) {
4return [(a & 4278190080) >> 24, (a & 16711680) >> 16, (a & 65280) >> 8, a & 255];
5}
13}
14};
15export async function decryptURL(a, X) {
16try {
17var r0 = CryptoJS.AES.decrypt(a, X);
23}
2425export async function decryptSource(keys, kversion, response) {
26let encrypted = response.sources;
27console.log(kversion);
38return response;
39}
40export async function getMeta(id) {
41const req = await fetch(`https://rabbitstream.net/v2/embed-4/${id}?z=`, {
42headers: {
54return metaMatch[1];
55}
56export async function getWasm() {
57const req = await fetch("https://rabbitstream.net/images/loading.png?v=0.6", {
58"headers": {
WundergroundStationDisplayV2main.tsx4 matches
7import { createRoot } from "https://esm.sh/react-dom/client";
89function calculateDensityAltitude(elevation, temperature, pressure) {
10// Convert temperature to Celsius
11const tempC = (temperature - 32) * 5 / 9;
20}
2122function App() {
23const [weatherData, setWeatherData] = useState(null);
24const [error, setError] = useState(null);
134}
135136function client() {
137createRoot(document.getElementById("root")).render(<App />);
138}
140if (typeof document !== "undefined") { client(); }
141142async function server(request: Request): Promise<Response> {
143const url = new URL(request.url);
144const stationId = url.searchParams.get("stationId");
jsonToDalleFormmain.tsx4 matches
6import { systemPrompt } from "https://esm.town/v/weaverwhale/jtdPrompt";
78// Move OpenAI initialization to server function
9let openai;
1011function App() {
12const [json, setJson] = useState("");
13const [imageUrl, setImageUrl] = useState("");
128`;
129130function client() {
131createRoot(document.getElementById("root")).render(<App />);
132}
136}
137138async function server(request: Request): Promise<Response> {
139const url = new URL(request.url);
140
leaderboardAppmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [page, setPage] = useState("home");
7const [showModal, setShowModal] = useState(false);
153}
154155function client() {
156createRoot(document.getElementById("root")).render(<App />);
157}
159if (typeof document !== "undefined") { client(); }
160161async function server(request: Request): Promise<Response> {
162return new Response(
163`
hackerNewsDigestmain.tsx4 matches
3import { email } from "https://esm.town/v/std/email";
45async function fetchStories(type: string, count: number) {
6const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
7const storyIds = await response.json();
15}
1617function createStoryHTML(story: any) {
18return `
19<li>
28}
2930function createEmailContent(
31topStories: any[],
32newStories: any[],
118}
119120export default async function server(req: Request) {
121try {
122const topStories = await fetchStories("top", 10);
quotableApiProxymain.tsx1 match
1import { fetch } from "https://esm.town/v/std/fetch";
23export default async function proxy(req: Request) {
4const resp = await fetch(
5"http://api.quotable.io/quotes/random?limit=1",
telegrambotmain.tsx6 matches
14const openai = new OpenAI();
1516async function POST(cmd: string, data: { [key: string]: string }) {
17const url = BOT + "/" + cmd;
18return await (await fetch(
26}
2728async function GET(cmd: string) {
29return await (await fetch(BOT + "/" + cmd)).json();
30}
3132async function sendMessage(chat_id: string, text: string) {
33return await POST("sendMessage", { chat_id, text });
34}
3536async function setWebhook(url: string) {
37return await POST("setWebhook", { url });
38}
3940async function getWebhookInfo() {
41return await GET("getWebhookInfo");
42}
4344export default async function(req: Request): Promise<Response> {
45const url = new URL(req.url);
46const path = url.pathname;
upsetSilverLimpetmain.tsx10 matches
15}
1617export default async function(interval: Interval): Promise<void> {
18try {
19await createTable();
3839// Create an SQLite table
40async function createTable(): Promise<void> {
41await sqlite.execute(`
42CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (
5051// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53return hackerNewsSearch({
54query: topic,
58}
5960async function fetchTwitterResults(topic: string): Promise<Website[]> {
61return twitterSearch({
62query: topic,
67}
6869async function fetchRedditResults(topic: string): Promise<Website[]> {
70return redditSearch({ query: topic });
71}
7273function formatSlackMessage(website: Website): string {
74const displayTitle = website.title || website.url;
75return `*<${website.url}|${displayTitle}>*
78}
7980async function sendSlackMessage(message: string): Promise<Response> {
81const slackWebhookUrl = Deno.env.get("SLACK_WEBHOOK_URL");
82if (!slackWebhookUrl) {
104}
105106async function isURLInTable(url: string): Promise<boolean> {
107const result = await sqlite.execute({
108sql: `SELECT 1 FROM ${TABLE_NAME} WHERE url = :url LIMIT 1`,
112}
113114async function addWebsiteToTable(website: Website): Promise<void> {
115await sqlite.execute({
116sql: `INSERT INTO ${TABLE_NAME} (source, url, title, date_published)
120}
121122async function processResults(results: Website[]): Promise<void> {
123for (const website of results) {
124if (!(await isURLInTable(website.url))) {