Skip to content

Instantly share code, notes, and snippets.

View TonPC64's full-sized avatar
:shipit:
Gopher

Chanwit Piromplad TonPC64

:shipit:
Gopher
View GitHub Profile
@bouroo
bouroo / thai-id-card.go
Last active January 8, 2025 12:51
Thai National ID Card reader in GO
package main
import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"os"
"strconv"
@alvaropinot
alvaropinot / map-to-object.js
Created October 3, 2017 17:58
"FUNctional" 😜 Map 🗺 to object 🔑
const obj = { a: 1, c: 3, b: 2 }
// Map from object.
const myMap = new Map(Object.entries(obj))
// Map to Object.
// NOTE: Keys will be cast to strings by `.toString`, so any "complex" key like for example `[1, 2]` will become `1,2`
const newObj = [...myMap.entries()]
.reduce((acc, [key, value]) => (Object.assign(acc, { [key]: value })), {})
@parmentf
parmentf / GitCommitEmoji.md
Last active March 10, 2025 07:10
Git Commit message Emoji
@dtjm
dtjm / join_test.go
Last active December 20, 2024 07:25
Benchmarking various ways of concatenating strings in Go
package join
import (
"fmt"
"strings"
"testing"
)
var (
testData = []string{"a", "b", "c", "d", "e"}