- Wrapper for solana actions / solana pay
- Uses Hono (setup to be deployed to cloudflare)
npm install gist:c583db7577fc258570dfa2dbdb73be7e
| <div id="root"></div> | |
| <script> | |
| /** | |
| * Poorman's jQuery | |
| */ | |
| const $ = document.querySelector.bind(document); | |
| /** |
| import { createMiddleware } from "hono/factory"; | |
| import { sign, verify } from "hono/jwt"; | |
| import { IEnv, ISession } from "./types"; | |
| /** | |
| * @usage | |
| * | |
| * const app = new Hono<{ Bindings: { JWT_SECRET:string } }>() | |
| * | |
| * .use("/*", sessions({ ttl: 86400 })) |
| /** | |
| * Strongly typed event emitter | |
| * | |
| * @usage | |
| * | |
| * const emitter = createEmitter<{ | |
| * signature: [{ publicKey: number[]; signature: number[] }]; | |
| * }>(); | |
| * | |
| * emitter.on("signature", ({ publicKey, signature }) => { |
| /** | |
| * sort array (of objects) by multiple values | |
| */ | |
| function sort (order) { | |
| return function by (head, ...tail) { | |
| return function comparator (a, b) { | |
| if (!head) return 0; | |
| if (a[head] > b[head]) return order; | |
| if (a[head] < b[head]) return -order; |
| const fs = require('fs'); | |
| const hyperquest = require('hyperquest'); | |
| const pump = require('pump'); | |
| const xray = require('x-ray'); | |
| const parse = require('json-parse-stream'); | |
| const through = require('through2').obj; | |
| const x = xray().throttle(1, 300); // be considerate | |
| const schema = [{ |
| /** | |
| * Print SVG that will render a rectangular tooltip with a tip at the bottom | |
| */ | |
| setTimeout(function() { | |
| console.log( | |
| '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="' + | |
| getTooltipPath(10, 10, 200, 80, 4, 10, 2, 'top').toString() + | |
| '" fill="#777777"/></svg>' | |
| ); |
| for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done |