Skip to content

Instantly share code, notes, and snippets.

View staciax's full-sized avatar
🖤
I may be slow to respond.

STACIA staciax

🖤
I may be slow to respond.
  • Bangkok, Thailand
  • 12:20 (UTC +07:00)
  • X @stacia__x
View GitHub Profile
@popravich
popravich / PostgreSQL_index_naming.rst
Last active December 4, 2025 06:27
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@lopspower
lopspower / README.md
Last active December 15, 2025 00:48
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@silkyland
silkyland / strToThaiSlug.js
Last active May 20, 2024 01:32
Convert string to slug in Thai language for SEO Friendly in JavaScript
/**
* Translates a string to a Thai slug format.
* @param {string} inputString - The string to translate.
* @returns {string} The translated string.
*/
function toThaiSlug(inputString) {
// Replace spaces with hyphens
let slug = inputString.replace(/\s+/g, '-');
// Translate some characters to Thai
@fnky
fnky / ANSI.md
Last active December 14, 2025 22:15
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@bact
bact / thai_strftime.py
Last active September 6, 2024 16:25
Thai date and time string formatter
# thai_strftime()
# Thai date and time string formatter
# Formatting directives similar to datetime.strftime()
#
# จัดรูปแบบข้อความวันที่และเวลา แบบเดียวกับ datetime.strftime()
# โดยจะใช้ชื่อเดือนเป็นภาษาไทย และปีเป็นพุทธศักราช
# (ไม่รองรับปีก่อน พ.ศ. 2484 - ก่อนการเปลี่ยนวันปีใหม่ไทย)
#
# No Rights Reserved
# PUBLIC DOMAIN or CC0 1.0 Universal
@igorjs
igorjs / rest-api-response-format.md
Last active July 31, 2025 12:04
REST API response format based on some of the best practices
@sgdan
sgdan / dockerignore-test.sh
Created May 11, 2019 23:58
Test the ".dockerignore" file to ensure the build context doesn't contain unwanted files
#!/bin/sh
# Based on BMitch's answer from:
# https://stackoverflow.com/questions/38946683/how-to-test-dockerignore-file
# Note: will create and delete temporary file "Dockerfile.build-context"
# 1. Copy to project folder where image is being built
# 2. Run script
# 3. You should see list of files in build context
@mcroach
mcroach / storing-image-assets-in-repo.md
Last active September 27, 2025 08:08
Using an 'assets' branch to store images in your repo

Storing image assets in your repo and referencing in markdown

Create an assets branch and make the initial commit

git checkout --orphan assets
git reset --hard
cp /path/to/cat.png .
git add .
git commit -m 'Added cat picture'
git push -u origin assets
@fsjorgeluis
fsjorgeluis / hashAndCompare.ts
Last active January 25, 2025 09:46
Functions to hash and compare password using bcrypt library and typescript
import * as bcrypt from 'bcrypt';
/**
* Hash password using bcrypt library
* @param password String
* @returns string type
*/
export const HashPassword = async (password: string): Promise<string> => {
const salt = await bcrypt.genSalt();
const hash = await bcrypt.hash(password, salt);
@Kavan72
Kavan72 / endpoints.txt
Last active November 5, 2025 09:09
Valorant endpoints
[PlayerFeedback_CheckForSurvey] POST
[PlayerFeedback_SendAnswers] POST
[PatchNotes_GetPatchNotes] GET
[AggStats_Fetch] GET
[AccountXP_GetPlayer] GET https://pd.ap.a.pvp.net/account-xp/v1/players/{user_id}
[Config_FetchConfig] GET https://shared.ap.a.pvp.net/v1/config/ap