Skip to content

Instantly share code, notes, and snippets.

View lannonbr's full-sized avatar

Benjamin Lannon lannonbr

View GitHub Profile
@lannonbr
lannonbr / tinkaton-price.js
Created February 3, 2024 15:44
ScriptKit script to track Paldean Fates TCGPlayer market price and see if it ever drops below a certain price
// Name: Tinkaton Price
import "@johnlindquist/kit";
import pokemon from "pokemontcgsdk";
pokemon.configure({ apiKey: process.env["POKEMON_TCG_API_TOKEN"] });
const cardId = "sv4pt5-167";
const belowPrice = 3;
// Name: image-resizer
import "@johnlindquist/kit"
const files = await drop("Drop folder of files to be resized here")
@lannonbr
lannonbr / esm-checker-add-description.js
Created March 10, 2022 00:21
One off script for ESM Checker to add a description attribute to items in a package table
require("dotenv").config();
const fetch = require("node-fetch");
const { DynamoDBClient } = require("@aws-sdk/client-dynamodb");
const {
DynamoDBDocumentClient,
UpdateCommand,
ScanCommand,
} = require("@aws-sdk/lib-dynamodb");
const ddbClient = new DynamoDBClient();
@lannonbr
lannonbr / learn-with-jason-search.js
Created April 2, 2021 18:44
A Script Kit script to browse the collection of episodes on learnwithjason.dev
// Menu: Learn with Jason Search
// Description: Browse Learn With Jason Episodes
// Author: Benjamin Lannon
// Twitter: @lannonbr
let episode = await arg(`Search for an episode of Learn with Jason`, async () => {
const resp = await get('https://www.learnwithjason.dev/episodes.json')
return resp.data.episodes.map(episode => {
return {
@lannonbr
lannonbr / index.js
Created June 20, 2020 04:36
easymidi example w/ Launchpad Mini MK3
const easyMidi = require("easymidi");
const launchpadInput = new easyMidi.Input(
"Launchpad Mini MK3 LPMiniMK3 MIDI Out"
);
const launchpadOutput = new easyMidi.Output(
"Launchpad Mini MK3 LPMiniMK3 MIDI In"
);
@lannonbr
lannonbr / lib.js
Created January 7, 2020 15:06
Using fs.readFileSync in Rust with WASM
const fs = require('fs')
function readFile(path) {
return fs.readFileSync(path, { encoding: 'utf8' })
}
module.exports = {
readFile
}
day hour value
Sun 0 2
Sun 1 2
Sun 2 3
Sun 3 3
Sun 4 4
Sun 5 2
Sun 6 2
Sun 7 2
Sun 8 2
@lannonbr
lannonbr / base-check.yml
Created December 8, 2019 22:41
Do stuff only in a main repo and not forks
on: push
name: Workflow
jobs:
work:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- id: base_check
name: check if repo is base
run: |
@lannonbr
lannonbr / build-on-push.yml
Created November 5, 2019 01:17
GitHub Actions example of doing a build on push excluding when changes are made in the .github folder
name: Build on push
on:
push:
paths-ignore:
- ".github/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@lannonbr
lannonbr / scrollbug.html
Created October 3, 2019 13:09
Bug that window.scrollTo running immediately works in firefox, but not chrome, and can be fixed with a setTimeout(callback, 0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
width: 10000px;