Skip to content

Instantly share code, notes, and snippets.

@jimfoltz
jimfoltz / tw5-server.rb
Last active February 26, 2024 02:18
A local server for TiddlyWiki5 that allows saving wiki.
require 'webrick'
require 'fileutils'
if ARGV.length != 0
root = ARGV.first.gsub('\\', '/')
else
root = '.'
end
BACKUP_DIR = 'bak'
@posener
posener / go-shebang-story.md
Last active July 13, 2024 16:35
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@koenbollen
koenbollen / kns.bash
Last active August 13, 2020 10:31
kns - Quick kubectl namespace switcher
#!/bin/bash
# kns lets you select a kubernetes namespace in seconds. Autocomplete,
# type-ahead, everything! (tested in bash and zsh)
kns() {
local current
local namespace
local selected
if [[ ! -x "$(which fzf 2>/dev/null)" ]]; then
echo "please install: github.com/junegunn/fzf" >&2
@begriffs
begriffs / sqitch_alternatives.txt
Created November 19, 2015 21:13
sqitch alternatives
https://github.com/flyway/flyway
https://github.com/mattes/migrate
https://bitbucket.org/liamstask/goose
https://github.com/tanel/dbmigrate
https://github.com/BurntSushi/migration
https://github.com/DavidHuie/gomigrate
https://github.com/rubenv/sql-migrate