Skip to content

Instantly share code, notes, and snippets.

View johnlindquist's full-sized avatar
💭
Eating a taco 🌮

John Lindquist johnlindquist

💭
Eating a taco 🌮
View GitHub Profile
// Name: Testing Script Bundle
// Shortcut: ctrl 0
import "@johnlindquist/kit";
const script = await selectScript("Testing", true, (scripts) =>
scripts.filter((script) => script.name.startsWith("Testing"))
);
await run(script.filePath);
// Name: Paste Input
import "@johnlindquist/kit";
const input = await arg();
await setSelectedText(input);
// Name: Testing Restart Prompt
import "@johnlindquist/kit";
let errorCount = 0;
let noError = false;
while (!noError) {
try {
throw new Error();
} catch (e) {
// Name: Testing Restart Prompt
import "@johnlindquist/kit";
let errorCount = 0;
let error = true;
while (error) {
error = false;
try {
throw new Error();
// Name: Testing Restart Prompt
import { Action } from "@johnlindquist/kit";
let errorCount = 0;
let error = true;
while (error) {
error = false;
try {
throw new Error();
// Name: Testing Currently Active
import "@johnlindquist/kit";
import { Choice } from "@johnlindquist/kit";
const css = `
.active {
background-color: green;
}
`;
// Name: Testing Template Shortcut Override
import "@johnlindquist/kit";
const result = await template(`($1)$0`, {
shortcuts: [
{
name: "Submit",
key: `${cmd}+enter`,
bar: "right",
// Name: Testing Template with Selection
// Shortcut: opt 7
import "@johnlindquist/kit";
const selectedText = await getSelectedText();
const templates = [
{
name: "par",
// Name: Testing Widget
import "@johnlindquist/kit";
// await hide();
await widget(`Hi there`);
// Name: Testing Widget
import "@johnlindquist/kit";
// await hide();
await widget(`Hi there`);