Skip to content

Instantly share code, notes, and snippets.

@CarsonSlovoka
CarsonSlovoka / clone_n_node.sh
Created July 29, 2025 06:26
git clone *.xlsx
git rev-list HEAD --count # 1722
git log --oneline --since="2025-03-20" --reverse | head -n 1
# 40b3136
echo "1722 - 1367" | bc
# 355
git clone file://$(realpath ..) --depth=355 --no-checkout ~/Downloads/temp/test-git/
-- USAGE:
-- CSV_PATH=temp.csv lua5.1 read_csv.lua
local csv_path = os.getenv("CSV_PATH") or "your_file.csv"
local file = io.open(csv_path, "r")
if not file then
print("無法打開文件: " .. csv_path)
return
end
@CarsonSlovoka
CarsonSlovoka / README.md
Last active May 21, 2025 01:47
for answer SSH reverse tunneling with ngrok

If you don't have the ~/.ssh/config file, you can create one yourself and then fill it with the content you need.

You can refer to the video around 0:51

This file is just for simplification. In fact, you can also use:

ssh -i ~/.ssh/my_privK -R 443:localhost:80 [email protected] http

@CarsonSlovoka
CarsonSlovoka / config.sh
Last active November 28, 2024 06:11
~./.config/sway/config
output DVI-D-1 mode 1920x1080@60Hz
output DP-1 mode 1920x1080@60Hz
bindsym $left resize shrink width 200px
bindsym $down resize grow height 200px
bindsym $up resize shrink height 200px
bindsym $right resize grow width 200px
bindsym Left resize shrink width 200px
@CarsonSlovoka
CarsonSlovoka / go.mod
Created September 14, 2024 08:39
go draw_text eample: winapi.{TextOut, ExtTextOut}
module demo-draw-text
go 1.23.0
require github.com/CarsonSlovoka/go-pkg/v2 v2.4.2-0.20240619074555-8d486f5913b0
@CarsonSlovoka
CarsonSlovoka / int_range.go
Created September 11, 2024 08:07
demo int range
package main
import (
"fmt"
)
func Example_int8_range() {
for _, val := range []byte{
0b1000_0000,
0b1000_0001,
package main
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"encoding/pem"
@CarsonSlovoka
CarsonSlovoka / README.md
Last active August 19, 2024 11:24
xml.UnmarshalXML

go想對xml的時間自定義Unmarshal,那麼要滿足 xml.Unmarshaler 接口

type Unmarshaler interface {
	UnmarshalXML(d *Decoder, start StartElement) error
}

go-playground

package main
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"encoding/pem"