Skip to content

Instantly share code, notes, and snippets.

<html>
<body>
<video id="player" autoplay muted playsinline></video>
<button id="capture">Capture</button>
<canvas id="canvas"></canvas>
<script>
const player = document.getElementById('player');
const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
const captureButton = document.getElementById('capture');
#!/bin/sh
export PROJECT_ID=...
export LOCATION=us-central1
export OPENAI_API_KEY="$(gcloud auth application-default print-access-token)"
export MODEL_ID="google/gemini-2.5-flash"
export OPENAI_BASE_URL="https://${LOCATION}-aiplatform.googleapis.com/v1beta1/projects/${PROJECT_ID}/locations/${LOCATION}/endpoints/openapi"
echo $OPENAI_API_KEY
echo $MODEL_ID

branch with current year and week number

git co -b "$(date +%Y-%W)"
#!/bin/sh
cat Localizable.xcstrings | jq -r '
.strings
| to_entries[]
| [.key,
(.value.localizations."zh-Hans".stringUnit.value // ""),
(.value.localizations."zh-Hant".stringUnit.value // ""),
(.value.localizations.ja.stringUnit.value // ""),
(.value.localizations.ko.stringUnit.value // ""),