Skip to content

Instantly share code, notes, and snippets.

View radityopw's full-sized avatar

radityo radityopw

View GitHub Profile
@radityopw
radityopw / arsitektur-classic-prosedural-php.md
Last active November 8, 2026 23:45
arsitektur classic prosedural php

Panduan Arsitektur & Standar Pola Classic PHP Procedural

Dokumen ini merangkum pedoman desain, tata letak berkas, dan konvensi penulisan kode untuk migrasi proyek PHP ke gaya classic web procedural. Pola ini mengutamakan kesederhanaan alur kerja request-response native, meminimalkan abstraksi berlebih (tanpa OOP/class), menghindari polusi variabel global, serta memisahkan logika tampilan dengan penangan aksi.

1. Filosofi & Prinsip Utama

  1. Alur Alami Web (Linear Request-Response)

    Setiap berkas PHP bertindak langsung sebagai penangan permintaan HTTP. Jalur kerja dapat ditelusuri dari baris pertama hingga baris terakhir tanpa lapisan routing atau penumpukan kelas.

@radityopw
radityopw / Dockerfile
Created October 27, 2026 14:15
Dockerfile untuk radityopw/radit-2004
FROM ubuntu:20.04
LABEL author="Radityo P W (radityo.p.w@gmail.com)"
ARG DEBIAN_FRONTEND=noninteractive
# Pasang utilitas sistem, dependensi kompilasi, gnupg untuk keyring, dan locale
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
curl \
@radityopw
radityopw / Dockerfile
Last active September 1, 2026 04:38
docker file radit-26.04
FROM ubuntu:26.04
LABEL author="Radityo P W (radityo.p.w@gmail.com)"
ARG DEBIAN_FRONTEND=noninteractive
# Update sistem dan instal utilitas dasar, Apache, serta modul PHP 8.5
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
curl \
@radityopw
radityopw / README
Created August 8, 2026 09:17
contoh RAG text to SQL php dan ollama
Panduan Instalasi Ollama dan Eksekusi PHP CLI
1. Persiapan Perangkat Lunak
Pastikan PHP versi 8.0 atau yang lebih baru telah terpasang pada sistem operasi Anda.
Aktifkan extension pdo_sqlite, curl, dan json di dalam berkas php.ini.
2. Instalasi dan Setup Ollama
@radityopw
radityopw / install-odbc-sqlserver.sh
Created June 14, 2026 14:50
Install the Microsoft ODBC driver for SQL Server (Linux) Microsoft ODBC 18
if ! [[ "18.04 20.04 22.04 24.04 25.10" == *"$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)"* ]];
then
echo "Ubuntu $(grep VERSION_ID /etc/os-release | cut -d '"' -f 2) is not currently supported.";
exit;
fi
# Download the package to configure the Microsoft repo
curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
# Install the package
sudo dpkg -i packages-microsoft-prod.deb
@radityopw
radityopw / Dockerfile
Created December 18, 2025 13:25
Docker Ubuntu 20.04 apache2 php mysqldriver
FROM ubuntu:20.04
LABEL author="Radityo P W (radityo.p.w@gmail.com)"
ENV DEBIAN_FRONTEND=noninteractive TZ="Asia/Jakarta"
# UPDATE PACKAGES
RUN apt update
# INSTALL SYSTEM UTILITIES
RUN apt install -y \
@radityopw
radityopw / Dockerfile
Created July 20, 2025 14:22
Docker file untuk GCP php 8.3 versi CLI dengan ext grpc dan protobuf, digunakan untuk cloud run job
# Use the official PHP image.
# https://hub.docker.com/_/php
FROM php:8.3-cli
# Menginstal dependensi yang diperlukan untuk ekstensi PHP
# Pastikan untuk membersihkan cache APT setelah instalasi untuk menjaga ukuran image tetap kecil
RUN apt-get update && apt-get install -y libcurl4-openssl-dev autoconf zlib1g-dev && rm -rf /var/lib/apt/lists/*
# Menginstal ekstensi PHP curl
@radityopw
radityopw / Dockerfile
Created July 20, 2025 13:26
Docker file untuk php 8.3 yang dibuat khusus untuk GCP dengan library firestore dan cloud storage
# Use the official PHP image.
# https://hub.docker.com/_/php
FROM php:8.3-apache
# Menginstal dependensi yang diperlukan untuk ekstensi PHP
# Pastikan untuk membersihkan cache APT setelah instalasi untuk menjaga ukuran image tetap kecil
RUN apt-get update && apt-get install -y libcurl4-openssl-dev autoconf zlib1g-dev && rm -rf /var/lib/apt/lists/*
# Menginstal ekstensi PHP curl
@radityopw
radityopw / Dockerfile
Last active July 18, 2025 07:34
Docker file untuk build image php di ubuntu 24.04 LTS yang siap menggunakan firestore di gcp
FROM ubuntu:24.04
LABEL author="Radityo P W (radityo.p.w@gmail.com)"
# UPDATE PACKAGES
RUN apt update
# INSTALL SYSTEM UTILITIES
RUN apt install -y \
build-essential \
apache2 \
@radityopw
radityopw / a-pg-util-query.txt
Last active November 29, 2024 00:58
query utilitas postgresql
kumpulan query utilitas untuk postgresql