Skip to content

Instantly share code, notes, and snippets.

View moomdate's full-sized avatar
🍋
~/.profile

moomdate moomdate

🍋
~/.profile
  • bangkok
View GitHub Profile
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 26, 2026 09:14
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@sdnts
sdnts / example.md
Last active January 10, 2023 20:50
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});
@rushilgupta
rushilgupta / GoConcurrency.md
Last active February 9, 2026 20:17
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@AnthonyNahas
AnthonyNahas / java_vs_kotlin.md
Last active May 27, 2024 12:38
Java vs Kotlin - the quick comparison

1. Types and Operators

Java

// variable
int x = 1;

// constant
final int y = 2; 
@up1
up1 / timeout.go
Created April 16, 2019 07:22
Go Request Timeout
package main
import (
"context"
"log"
"net/http"
"time"
)
func main() {
# ============ Login K-Bank ========================
# To Use provide your username and password
# chmod -R 777 login_k-bank.sh
# ./login_k-bank.sh
# Please provide your username and password here
# This is not the best choice to use this script. because your password is saved on your machine and transfer through script
# Please consider K-Bank Open API instead https://apiportal.kasikornbank.com/open-api/
username=
password=
const fetchSheet = async (sheetId) => {
try {
var records = []
const response = await fetch(
`https://spreadsheets.google.com/feeds/list/${sheetId}/od6/public/values?alt=json`,
);
const responseJson = await response.json();
const { entry } = responseJson.feed;
records = entry.map(row => ({
column1: row.gsx$column1.$t,
(async () => {
// FarmersWorld Bot Script v1.0.6
// อัพเดทล่าสุด 13/11/2021 เวลา 03:30 น.
// ตัวแปรสำหรับตั้งค่าการเติม energy และ ซ่อมอุปกรณ์
// หากอยากให้ปิดอันไหนก็ใส่ค่าเป็น 0 เช่นอยากปิดการเติม energy ก็เปลี่ยนค่าเป็น 0
// ตัวอย่าง
// let autoFillEnergy = 0
let autoFillEnergy = 1
let autoRepair = 1