branch with current year and week number
git co -b "$(date +%Y-%W)"
branch with current year and week number
git co -b "$(date +%Y-%W)"
#!/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 |
<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'); |
// when does Go fail to encode JSON? | |
// https://go.dev/play/p/5ptv2ifv8_7 | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"math" | |
) |
// yes | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
) | |
type S struct { |
package main | |
import ( | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
) | |
type X struct { | |
B []byte `json:"b"` |
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# based on https://gist.github.com/karpathy/1dd0294ef9567971c1e4348a90d69285 | |
gcm() { | |
# Function to generate commit message |
// https://jameshfisher.com/2018/02/20/c-inline-assembly-hello-world/ | |
int main(void) { | |
register int syscall_no asm("rax") = 1; | |
register int arg1 asm("rdi") = 1; | |
register char* arg2 asm("rsi") = "hello, world!\n"; | |
register int arg3 asm("rdx") = 14; | |
asm("syscall"); | |
return 0; | |
} |
// https://go.dev/play/p/HTKZzENHPcG | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type Color struct{ c uint } |