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 base36 | |
| import textwrap | |
| import subprocess | |
| import re | |
| import argparse | |
| # Argument parsing | |
| parser = argparse.ArgumentParser(description="Generate nano vanity addresses and extract original string.") | |
| parser.add_argument("--string", required=True, help="The input string to process (e.g., 'keshav').") | |
| parser.add_argument("--length", type=int, required=True, help="Length of segments for text wrapping.") |
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
| Haven't decided the license yet so probably don't use it right away in your project ? | |
| Maybe I am thinking of creating a fork since creating the core functionality was rather trivial. | |
| <script lang="ts"> | |
| import { onMount } from 'svelte'; | |
| import Highlight from 'svelte-highlight'; | |
| import { d } from 'svelte-highlight/languages'; | |
| import javascript from 'svelte-highlight/languages/javascript'; | |
| import github from 'svelte-highlight/styles/github'; | |
| import githubDark from 'svelte-highlight/styles/github-dark'; |
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 { red } from "@std/fmt/colors"; | |
| Deno.stdin.setRaw(true); | |
| let chunk = new Uint8Array(0); | |
| let currentInput = ""; | |
| let cursorPosition = 0; | |
| const reader = Deno.stdin.readable.getReader(); | |
| while (true) { | |
| if (chunk.length === 0) { | |
| const readResult = await reader.read(); |
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 decoder = new TextDecoder(); | |
| export async function* readStdin() { | |
| for await (const chunk of Deno.stdin.readable) { | |
| const text = decoder.decode(chunk, { stream: true }); | |
| const lines = text.split("\n"); | |
| for (const line of lines) { | |
| if (line) { | |
| yield line; // Yield each non-empty line |
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 { readStdin } from "./readlines.ts"; | |
| import { BlobTicket, Iroh } from "npm:@number0/iroh"; | |
| const prompt = 'Type a message to share (or "exit" to quit): '; | |
| async function* inputLoop() { | |
| for await (const line of readStdin()) { // Use the new readStdin generator | |
| yield line; // Yield each line as it is read | |
| } | |
| } |
NewerOlder