Skip to content

Instantly share code, notes, and snippets.

@chwan1
Created April 12, 2023 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chwan1/82d6f643d9216e68101dc6b41388d5ed to your computer and use it in GitHub Desktop.
Save chwan1/82d6f643d9216e68101dc6b41388d5ed to your computer and use it in GitHub Desktop.
// Name: Tools
// Description:_
import "@johnlindquist/kit";
import { readFile } from "fs/promises";
await arg("Select a tool", [
// {
// name: "Sorry, no matches",
// info: "onNoChoices", // or "always"
// },
{
name: "QR Code",
description: "Generator website by Adobe",
onSubmit: async () => {
open("https://express.adobe.com/zh-Hant-TW/tools/qr-code-generator");
},
},
{
name: "Oblique Strategies",
description: "by Brian Eno and Peter Schmidt",
onSubmit: async () => {
const data = await readFile("./ObliqueStrategies.json", {
encoding: "utf-8",
});
const obliqueStrategiesList = JSON.parse(data);
const strategy =
obliqueStrategiesList[
Math.floor(Math.random() * obliqueStrategiesList.length)
];
await div(
strategy,
" bg-blue-600 p-8 flex flex-col items-center justify-center rounded-lg font-bold text-4xl text-gray-50",
);
},
},
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment