This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Prompt: Generate a use-case-specific Unsplash image skill | |
| Paste everything below the line into Claude Code (or any Claude session that can | |
| create files). It will interview you about *what kind* of images you want, walk | |
| you through getting an API key, and then scaffold a self-contained skill that | |
| finds, previews, and downloads images **while respecting Unsplash's attribution, | |
| hotlinking, and download-tracking rules.** | |
| The skill it produces is intentionally narrow and *named after your use case*, so | |
| you can generate several of them (one for retro landscapes, one for food |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function createPDF() { | |
| // Get the current Google Doc | |
| const doc = DocumentApp.getActiveDocument(); | |
| // Get the document ID and name | |
| const docId = doc.getId(); | |
| const docName = doc.getName(); | |
| // Get the folder where the document is located | |
| const file = DriveApp.getFileById(docId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| begin; | |
| set local jwt.sub = 'admin@gwcfb.org'; | |
| show jwt.sub; | |
| select listing_id, listing_name, listing_desc from farmers_markets_pa; | |
| -- allowed to update | |
| update farmers_markets_pa set listing_desc = 'updated @ ' || current_time where listing_id = 301498 returning listing_id; | |
| -- not allowed to update | |
| update farmers_markets_pa set listing_desc = 'updated @ ' || current_time where listing_id = 300430 returning listing_id; | |
| select listing_id, listing_name, listing_desc from farmers_markets_pa; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| azsub() { | |
| az account set --subscription $(az account list --all --query '[].[id, tenantDisplayName,name]' --out tsv | column -t -s $'\t'| fzf | awk '{print $1}') | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get editor completions based on the config schema | |
| "$schema" = 'https://starship.rs/config-schema.json' | |
| palette = 'osx' | |
| format = """ | |
| [](bold green)\ | |
| $os\ | |
| $username\ | |
| $directory\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { EventHubProducerClient } = require("@azure/event-hubs") | |
| const { chunkPromise, PromiseFlavor } = require('chunk-promise') | |
| var now = require("performance-now") | |
| var sp = require('streaming-percentiles') | |
| var epsilon = 0.1; | |
| var g = new sp.GK(epsilon); | |
| const TestCases = require("../events/test_cases.js") | |
| const impression = TestCases[0].expected.outputClientImpressionMessage[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| job = (input, batchNumber) => { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| console.log('Running batch ',batchNumber, 'processing ', input) | |
| resolve('completed ' + input) | |
| }, 1000) | |
| }) | |
| } | |
| async function batcher(inputArray, fn, batchSize) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** some examples for using and testing sprocs | |
| Needs the key in the env var: export cosmos_key="q2Mk..... | |
| npm i -s @azure/cosmos | |
| npm i -s uuid | |
| runHello will create a simple sproc, update it to the collection, and then test it | |
| runSprocCase will create a sproc that does a server-side update for atomic updates, pushes it to the collection, tests it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!env bash | |
| # | |
| # run source ./githublink to load this | |
| # | |
| # cd repo | |
| # gfh #opens the repo url | |
| # gfh filename #opens the file | |
| ghl() { | |
| CLIPONLY=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const assert = require('assert') | |
| function makeDeposits (deposits) { | |
| return 0 | |
| } | |
| const deposits = [0, 100, 100, 100] | |
| const expected = 300 | |
| const balance = makeDeposits(deposits) |
NewerOlder