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
import { $, write } from "bun"; | |
if (require.main === module) { | |
(async () => { | |
try { | |
const filePath = `${process.cwd()}/.gitignore`; | |
console.log(filePath); | |
const content = (await $`cat ${filePath}`.text().then(text => text.trim() | |
.replace(/[\u{1F600}-\u{1F64F}]/gu, "") | |
.replace(/[^\x00-\x7F]/g, "") |
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
import { $ } from 'bun'; | |
import { platform as osPlatform } from 'node:os'; | |
// Removed unused 'exec' import | |
/** | |
* Enum representing the detected operating system platform. | |
*/ | |
export enum Platform { | |
Windows = 'windows', | |
Mac = 'mac', |
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
import { argv, write } from 'bun'; | |
import path from 'node:path'; | |
import { Logger } from './logger.js'; | |
import { GoogleGenAI } from '@google/genai'; | |
/** | |
* Decorator that automatically instantiates a class when it's defined | |
*/ | |
function selfExecute<T extends { new(...args: any[]): {} }>(constructor: T): T { | |
new constructor(); |
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
"use strict"; | |
import { readableStreamToJSON, file } from 'bun'; | |
import { z } from 'zod'; | |
import { generateText } from 'ai'; | |
import { openai } from '@ai-sdk/openai'; | |
import { GoogleMapsService } from './map.js'; | |
import dotenv from 'dotenv'; | |
dotenv.config({ path: '.env' }); |
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
import { file, readableStreamToJSON, argv, write } from 'bun'; | |
import { z } from 'zod'; | |
const fireSchema = z.object({ | |
markdown: z.string(), | |
metadata: z.object({ | |
generator: z.string(), | |
viewport: z.string(), | |
language: z.string(), | |
description: z.string(), |
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
// @ts-nocheck | |
import { $, argv, } from 'bun'; | |
function selfExecute<T extends { new(...args: any[]): {} }>(constructor: T): T { | |
new constructor(); | |
return constructor; | |
} | |
@selfExecute | |
class Main { |
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
import { Octokit } from '@octokit/rest'; | |
import { env, argv } from 'bun'; | |
function selfExecute<T extends { new(...args: any[]): {} }>(constructor: T): T { | |
new constructor(); | |
return constructor; | |
} | |
@selfExecute | |
class Main { |
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
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
from pathlib import Path | |
from concurrent.futures import Future, ThreadPoolExecutor, as_completed | |
from time import perf_counter | |
import shutil | |
import logging | |
from typing import List, Set |
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
#!/usr/bin/env bun | |
import { $ } from "bun"; | |
// Function to fetch contents from GitHub API | |
// It now takes a 'depth' and 'currentDepth' for intelligent display and control | |
async function fetchContents(owner, repo, path = "", options = { maxDepth: Infinity, currentDepth: 0 }) { | |
const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`; | |
const indent = " ".repeat(options.currentDepth); // For visual indentation |
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
import { Elysia } from "elysia"; | |
import { cors } from '@elysiajs/cors'; | |
import { serverTiming } from '@elysiajs/server-timing'; | |
import type { SocketAddress } from "bun"; | |
import { rateLimit, DefaultContext, type Generator } from 'elysia-rate-limit'; | |
import { ip } from 'elysia-ip'; | |
const Stringify = (o: object) => JSON.stringify(o, null, 2) | |
const ipGenerator: Generator<{ ip: SocketAddress }> = (_req, _serv, { ip }) => ip?.address ?? 'unknown' |