This file contains 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
{ | |
"version": "4", | |
"specifiers": { | |
"jsr:@libs/logger@^3.1.0": "3.1.3", | |
"jsr:@oak/commons@1": "1.0.0", | |
"jsr:@oak/oak@^17.1.3": "17.1.3", | |
"jsr:@std/assert@1": "1.0.9", | |
"jsr:@std/bytes@1": "1.0.4", | |
"jsr:@std/bytes@^1.0.2": "1.0.4", | |
"jsr:@std/crypto@1": "1.0.3", |
This file contains 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
<? | |
# MIT license, do whatever you want with it | |
# | |
# This is my invoice.php page which I use to make invoices that customers want, | |
# with their address on it and which are easily printable. I love Stripe but | |
# their invoices and receipts were too wild for my customers on Remote OK | |
# | |
require_once(__DIR__.'/../vendor/autoload.php'); |
This file contains 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
{ | |
# replace 12 with the id of your choice | |
# if you want for a channel the value of symbol should be "cid:channel_username" | |
# eg: cid:fitness | |
subjectTokens(where: {symbol: "fid:12"}) { | |
tokenAddress: id | |
name | |
} | |
} |
This file contains 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 toBase64 = (file) => new Promise((resolve, reject) => { | |
const reader = new FileReader(); | |
reader.readAsDataURL(file); | |
reader.onload = (e) => resolve(e.target.result); | |
reader.onerror = (err) => reject(err); | |
}); | |
const compressBase64 = (src, quality = 0.5) => new Promise((resolve) => { | |
const img = new Image(); | |
img.src = src; |
This file contains 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
#!/bin/sh | |
# ngrok's web interface is HTML, but configuration is bootstrapped as a JSON | |
# string. We can hack out the forwarded hostname by extracting the next | |
# `*.ngrok.io` string from the JSON | |
# | |
# Brittle as all get out--YMMV. If you're still reading, usage is: | |
# | |
# $ ./ngrok_hostname.sh <proto> <addr> | |
# |
This file contains 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
>>> TURBOREPO | |
Welcome, let's convert your project. | |
? Where is the root of your repo? . | |
? Convert from yarn workspaces to: pnpm workspaces | |
Converting project from yarn to pnpm. |
This file contains 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
FROM gitpod/workspace-full | |
RUN curl -fsSL https://deno.land/x/install/install.sh | sh | |
RUN /home/gitpod/.deno/bin/deno completions bash > /home/gitpod/.bashrc.d/90-deno && \ | |
echo 'export DENO_INSTALL="/home/gitpod/.deno"' >> /home/gitpod/.bashrc.d/90-deno && \ | |
echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/90-deno |
This file contains 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
Certainly! Here's a TypeScript function that takes a text string as input and returns an array of code snippets found within code blocks wrapped in triple backticks(```) or `<code>`: | |
```typescript | |
function extractCodeSnippets(text: string): string[] { | |
const codeSnippets: string[] = []; | |
const regex = /```([\s\S]*?)```|<code>([\s\S]*?)<\/code>/g; | |
let match; | |
while ((match = regex.exec(text)) !== null) { | |
const codeSnippet = match[1] || match[2]; |
This file contains 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
Certainly! Here's a TypeScript function that takes a text as input and returns an array of code snippets found within multiple lines code blocks wrapped in triple backticks (```) or `<code>` tags with language tags: | |
```typescript | |
function extractCodeSnippets(text: string): { language: string, code: string }[] { | |
const codeBlockRegex = /```(\w+)\n([\s\S]*?)```|<code(?:\s+class="language-(\w+)")?>([\s\S]*?)<\/code>/g; | |
const codeSnippets: { language: string, code: string }[] = []; | |
let match; | |
while ((match = codeBlockRegex.exec(text)) !== null) { | |
const [, language1, code1, language2, code2] = match; |
NewerOlder