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: GitHub Karabiner Examples
import "@johnlindquist/kit"
let recentsPath = kenvPath("recent", "queries.txt")
let recentsContent = await ensureReadFile(recentsPath)
let recents = recentsContent.split("\n").filter(r => r.length > 0)
const OPEN_RECENTS = "Open recents.txt"
let choices = groupChoices(
// Name: GitHub Karabiner Examples
import "@johnlindquist/kit"
import express from "express"
let app = express()
let recentsPath = kenvPath("recent", "queries.txt")
let recentsContent = await ensureReadFile(recentsPath)
let recents = recentsContent.split("\n").filter(r => r.length > 0)
// Name: Search by Value
import "@johnlindquist/kit"
let fruits = [
{ name: "Apple", description: "A sweet, edible fruit", value: "USA" },
{ name: "Banana", description: "A long, curved fruit", value: "South America" },
{ name: "Cherry", description: "A small, round fruit", value: "Europe" },
{ name: "Date", description: "A sweet, chewy fruit", value: "Middle East" },
{ name: "Elderberry", description: "A small, dark fruit", value: "North America" },
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()