Skip to content

Instantly share code, notes, and snippets.

View voratham's full-sized avatar
🤔
finding learning new thing ?

Voratham.Siri voratham

🤔
finding learning new thing ?
  • Thailand, Samut Prakarn
View GitHub Profile
@voratham
voratham / k3d-create-cluster-no-traefik.sh
Created January 24, 2023 08:33 — forked from smijar/k3d-create-cluster-no-traefik.sh
k3d create cluster without traefik and serverlb
# Possibly obsolete: k3d create --name testcls1 --workers 3
k3d create --name testcls1 --workers 3 --server-arg "--no-deploy=traefik" --server-arg "--no-deploy=servicelb"
# UPDATE: in newer versions onwards, this has evolved to (thanks to comments below):
k3d cluster create --k3s-arg "--no-deploy=traefik@server:*"
@voratham
voratham / nearby-coordinates.sql
Created October 27, 2022 16:07 — forked from statickidz/nearby-coordinates.sql
Ordering with SQL by nearest latitude & longitude coordinates (MySQL & SQLite)
---
METHOD 1
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.
---
SELECT *
FROM table
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC
@voratham
voratham / filebuffer.go
Created September 21, 2021 07:05 — forked from minikomi/filebuffer.go
Read file to buffered bytes buffer in chunks.
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"os"
)
@voratham
voratham / getting_started.md
Created September 3, 2019 12:25 — forked from kidchenko/config.yml
Codesanook #06

Getting started

Requirements

Run these commands and install what do you not have

git --version

node --version