Skip to content

Instantly share code, notes, and snippets.

View gatspy's full-sized avatar

CG.gatspy gatspy

View GitHub Profile
@gatspy
gatspy / helpful-docker-commands.sh
Created July 1, 2024 06:57 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@gatspy
gatspy / gist:da58b62b2f5e0a42b2bb45eade0a542d
Created March 1, 2023 06:22 — forked from gtors/gist:effe8eef7dbe7052b22a009f3c7fc434
Makefile -> compilation_commands.json
@gatspy
gatspy / 00_README.md
Created November 25, 2022 07:57 — forked from YumaInaura/00_README.md
Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.

I read Go by Example topics.

@gatspy
gatspy / README.md
Created November 5, 2022 04:46 — forked from goll/README.md
Docker nftables configuration for Debian 10
@gatspy
gatspy / readme.txt
Created October 8, 2022 19:55 — forked from masdude/readme.txt
小容量MBP外接固态硬盘扩容解决方案
针对小容量mac book扩容的解决方案
需要购买:
1.nvme硬盘盒
2.大容量 nvme固态硬盘(推荐500G以上容量)
推荐下面这种侧插式nvme硬盘盒,完美匹配mac book,速度是10Gb/s,而且关机也不用取下。
缺点是要占用一边两个雷电接口,硬盘盒自带一个充电接口,
算下来其实还好,不充电的情况下,多占了一个雷电接口。
@gatspy
gatspy / logger.go
Created July 31, 2022 18:02 — forked from rnyrnyrny/logger.go
log using uber zap and lumberjack
// NOTE
// This gist was created long time ago.
// According to zap's doc, now we can use zapcore.AddSync to directly add lumberjack as a zap sync
// see https://github.com/uber-go/zap/blob/master/FAQ.md#does-zap-support-log-rotation
// So I wrote a new gist if anyone is interested:
// https://gist.github.com/rnyrnyrny/a6dc926ae11951b753ecd66c00695397
// thanks to:
// https://studygolang.com/articles/17394
// https://stackoverflow.com/questions/54395407/zap-logging-with-1-customized-config-and-2-lumberjack
@gatspy
gatspy / ANSI.md
Created May 28, 2022 05:04 — 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
@gatspy
gatspy / cloudSettings
Created May 16, 2020 10:33 — forked from tjx666/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-06T09:29:01.600Z","extensionVersion":"v3.4.3"}
@gatspy
gatspy / Makefile
Created April 26, 2020 09:02 — forked from rosado/Makefile
test if directory exists in a makefile
all: txtfile
TARGET_DIR = target-dir
txtfile: $(TARGET_DIR)
touch $(TARGET_DIR)/file.txt
target-dir:
test ! -d $(TARGET_DIR) && mkdir $(TARGET_DIR)
@gatspy
gatspy / qps-rate-limiting.go
Created March 6, 2020 20:54 — forked from linnv/qps-rate-limiting.go
HTTP QPS rate limiting in Golang
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"time"