Skip to content

Instantly share code, notes, and snippets.

export def ytsearch [] {
http get https://www.youtube.com/results?search_query=(input "search> " | url encode)
| split row "var ytInitialData ="
| last
| split row ";</script>"
| first
| from json
| get -o contents.twoColumnSearchResultsRenderer.primaryContents.sectionListRenderer.contents.0.itemSectionRenderer.contents.videoRenderer
| uniq | sort | drop
| select title.runs.text.0 videoId
@shaoyanji
shaoyanji / apisecrets-extension.sh
Last active January 5, 2026 12:56
minimalistic unixy way to run Google Gemini AI - dependency: curl, gum, yq
#!/usr/bin/env bash
#age -d -i ~/.ssh/id_ed25519 ~/.env.age | grep GEMINI | awk -F'=' '{print $2}'
export $(age -d -i ~/.ssh/id_ed25519 ~/.env.age)
let privatekeylocation = "key.txt"
let publicage = open $privatekeylocation | split row ": " | get 2 | split row "\n" | first
let pantryid = ""
let pantryurl = "https://getpantry.cloud/apiv1/pantry"
# 100 baskets (JSON objects)
# each with a max size of 1.44mb per basket
# API requests are limited to 2 calls per second. -from the FAQ
# https://getpantry.cloud/
# User and basket information
### Keybase proof
I hereby claim:
* I am shaoyanji on github.
* I am dragoncourt (https://keybase.io/dragoncourt) on keybase.
* I have a public key ASD18z4frT2hj2Lsm2NeSugayViupikXnFlKymEp3uk3ogo
To claim this, I am signing this object:
{
"basics": {
"email": "matt@bountystash.com",
"image": "https://profile-images.xing.com/images/e3a75519b933c0fad0259170ec9c42ee-3/shao-yan-ji.1024x1024.jpg",
"label": "Inter-Disciplinary Practitioner",
"altLabels": [
"Programmer, Engineer, Consultant"
],
"location": {
"address": "Am Burgerhof 4",