Skip to content

Instantly share code, notes, and snippets.

@blueray453
blueray453 / 001_tmux_init.fish
Created June 15, 2023 07:24
Auto start tmux session on fish shell
if status is-interactive
if not set -q TMUX
if tmux list-sessions &>/dev/null
set -l array
for i in (tmux list-sessions -F "#{session_name} #{session_attached}")
set -a array $i
end
if set -q array
@blueray453
blueray453 / ANSI.md
Created July 26, 2022 05:54 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@blueray453
blueray453 / go-shebang-story.md
Created June 29, 2019 14:37 — forked from posener/go-shebang-story.md
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.