Skip to content

Instantly share code, notes, and snippets.

@shanev
shanev / ci.cue
Created January 6, 2026 17:02
Imagine
// .github/workflows/ci.cue (sketch)
// --- Imports: typed reusable modules ---
import {
lint: "gh://org/ci/lint@v3"
docker: "gh://org/ci/docker@v2"
node: "gh://org/ci/node@v4"
}
// --- Inputs: strongly typed ---
@shanev
shanev / .zshrc
Created November 13, 2025 16:47
Setup git worktree names in Ghostty tabs in zsh
set_tab_title_to_worktree() {
local title git_root
if command -v git >/dev/null 2>&1; then
git_root=$(git rev-parse --show-toplevel 2>/dev/null)
[[ -n $git_root ]] && title=${git_root:t}
fi
[[ -z $title ]] && title=${PWD:t}
printf '\033]0;%s\007' "$title" # OSC 0 updates tab+window in most terms
printf '\033]1;%s\007' "$title"
printf '\033]2;%s\007' "$title"
@shanev
shanev / icon_create.sh
Created April 21, 2017 16:56
Generate an iOS app icon with a gradient background using an input image
#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
FILE="$DIR/../Design/appicon-foreground.svg"
OUTPUT_LOCATION="$DIR/../iTunes"
# convert svg asset to png
convert -density 2000 -resize 1024x1024 -background none $FILE appicon-foreground.png

A Tale of Two Name Services

Problem

The name alice can exist on multiple chains, owned by different accounts.

For example, alice.stars can point to a stars address that is associated with a different key than alice.stars on ICNS.

Solution 1: Merge ICNS and Stargaze Names

params.trading_fee_percent = trading_fee_bps
.map(Decimal::percent)
.unwrap_or(params.trading_fee_percent);
params.ask_expiry = ask_expiry.unwrap_or(params.ask_expiry);
params.bid_expiry = bid_expiry.unwrap_or(params.bid_expiry);
/*
* Wraps a cw721 contract with helpers.
* Adapted from https://github.com/CosmWasm/cw-plus/blob/main/contracts/cw721-base/helpers.ts.
*/
import {
CosmWasmClient,
SigningCosmWasmClient,
} from '@cosmjs/cosmwasm-stargate';
import { coins } from '@cosmjs/stargate';
@shanev
shanev / gist:990140
Created May 25, 2011 01:24
Ramones cover band looking for a singer
lets do this..
@shanev
shanev / vim_cheat.md
Last active September 5, 2021 16:30
vim8 Cheat Sheet

VIM CHEAT SHEET

Navigation

Quit all :qa

Go to top of file :gg

Go to bottom of file Shift-g

@shanev
shanev / tmux_cheat.txt
Last active July 22, 2021 15:54
tmux cheat
# start
tmux
# should see green bar at bottom
tmux list-sessions
tmux attach -t0
# detach current session
# Ctrl + b, release, then d
" execute pathogen#infect()
syntax on
filetype plugin indent on
:imap jj <Esc>
" old tab settings...
" show existing tab with 4 spaces width
" set tabstop=4
" when indenting with '>', use 4 spaces width