Skip to content

Instantly share code, notes, and snippets.

@wichian
wichian / baht_text.php
Created October 14, 2024 16:26 — forked from phattarachai/baht_text.php
PHP Bath Text ตัวเลขเงินบาทภาษาไทย
function baht_text($number, $include_unit = true, $display_zero = true): ?string
{
if (!is_numeric($number)) {
return null;
}
$BAHT_TEXT_NUMBERS = ['ศูนย์', 'หนึ่ง', 'สอง', 'สาม', 'สี่', 'ห้า', 'หก', 'เจ็ด', 'แปด', 'เก้า'];
$BAHT_TEXT_UNITS = ['', 'สิบ', 'ร้อย', 'พัน', 'หมื่น', 'แสน', 'ล้าน'];
$BAHT_TEXT_ONE_IN_TENTH = 'เอ็ด';
$BAHT_TEXT_TWENTY = 'ยี่';
@wichian
wichian / Dockerfile
Created October 20, 2023 02:25 — forked from fahmiegerton/Dockerfile
docker php-fpm alpine for codeigniter 4
# Image
FROM php:7.4.15-fpm-alpine3.12
# Set timezone
ENV TIMEZONE=Asia/Makassar
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && echo $TIMEZONE > /etc/timezone
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && sync && install-php-extensions \
@wichian
wichian / laravel-server-config.md
Last active September 22, 2023 05:43 — forked from yidas/laravel-server-config.md
Laravel Server Configuration for Nginx & Apache (Subdirectory)

Laravel Server Configuration for Nginx & Apache (Subdirectory)

It's easy to configurate a Laravel server site with directory protection:

Laravel Web Server Configuration

Sub Directory Site Application

Laravel smartly detects the current base url so that you don't need to set the base url for subdirectoy:

@wichian
wichian / line-pay-sample-codes.md
Created September 21, 2023 02:51 — forked from yidas/line-pay-sample-codes.md
LINE Pay API (v3) sample codes in multi-languages