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
import "@johnlindquist/kit"
import { chromium } from "playwright"
let browser = await chromium.launch({
headless: false, // Set to true if you do not need to see the browser
})
let page = await browser.newPage()
await page.setViewportSize({ width: 1920, height: 1080 })
await page.goto("https://scriptkit.com")
// Name: Shortcuts Condition
import "@johnlindquist/kit"
let value = await arg(
{
placeholder: `Type "one`,
shortcuts: [
{
name: "one",
// Name: Dictate to Editor
import "@johnlindquist/kit"
import Deepgram from "@deepgram/sdk"
let DEEPGRAM_API_KEY = await env("DEEPGRAM_API_KEY")
let client = new Deepgram.Deepgram(DEEPGRAM_API_KEY)
let deepgram = client.transcription.live({
punctuate: true,
})
import "@johnlindquist/kit"
// Name: Bulk Tip Draft Generator
// Author: Taylor Bell
// Description:
import escape from "escape-string-regexp"
import { ChatOpenAI } from "langchain/chat_models/openai"
import { ConversationChain } from "langchain/chains"
import { CallbackManager } from "langchain/callbacks"
import {
// Name: Testing Loading
import "@johnlindquist/kit"
await arg({
onInit: async () => {
setLoading(true)
},
})
// Name: Angular Assitant
import "@johnlindquist/kit"
import OpenAI from "openai"
const openai = new OpenAI()
const assistant = await openai.beta.assistants.update("asst_vlzQCeB9XG83GqQ4369ad2dp", {
name: "Angular Tutor",
instructions: `You are an Angular Tutor.
// Name: Notify and Prompt
import "@johnlindquist/kit"
import { NotificationCenter } from "node-notifier"
// Hide when testing from the main menu
hide()
const notifier = new NotificationCenter()
// Name: Actions Example
import { Action } from "@johnlindquist/kit"
/*
Using a "flag" determines where to do to custom logic: After the prompt or in the action
Also, "flags" are supported when running the script in the terminal with `--js`
*/
let actions: Action[] = [
// Name: Testing Regenerate List
import "@johnlindquist/kit"
let choices = ["one", "two", "three"].map(name => ({
name,
value: name,
id: uuid(), // This happens automatically behind the scenes if you don't do it manually
}))
/*
# Script Hub
You can access this on your phone from:
http://kit.local
Run a script by going to http://kit.local/my-script-name
*/