runme:
id: 01HF7BT3HD84GWTQB9008APC3C
version: v3
Examples
Shell
This is a basic snippet with shell command:
$ echo "Hello, runme!"
With {name=hello}
you can annotate it and give it a nice name:
$ echo "Hello, runme!"
It can contain multiple lines too:
$ echo "1"
$ echo "2"
$ echo "3"
Also, the dollar sign is not needed:
echo "Hello, runme! Again!"
It works with cd
, pushd
, and similar because all lines are executed as a single script:
temp_dir=$(mktemp -d -t "runme-XXXXXXX")
pushd $temp_dir
echo "hi!" > hi.txt
pwd
cat hi.txt
popd
pwd
Sometimes, shell scripts fail:
echo ok
exit 1
Interactive Scripts
echo -n "Enter your name: "
read name
echo ""
echo "Hi, $name!"
JavaScript
It can also execute a snippet of JavaScript code:
console.log("Hello World!");
Go
It can also execute a snippet of Go code:
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello from Go, runme!")
}
Unknown snippets
Snippets without provided type are ignored.
To still display unknown snippets, provide --allow-unknown
to the list
command.
[database]
username = admin
password = admin
Categories
echo "Category A"
echo "Category A,B"
echo "Category A,B,C"