Skip to content

Instantly share code, notes, and snippets.

View pararang's full-sized avatar
🎯
Focusing

Muhammad Ikhsan pararang

🎯
Focusing
View GitHub Profile
@pararang
pararang / hls.sh
Created November 9, 2024 14:04 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@pararang
pararang / docker-compose.yml
Created November 5, 2024 14:13
default docker compose and nginx conf to deploy wordpress with docker
version: '3'
services:
db:
image: mysql:8.0
container_name: db
restart: unless-stopped
env_file: .env
environment:
- MYSQL_DATABASE=wordpress
@pararang
pararang / nginx.conf
Last active November 5, 2024 14:13
default docker compose and nginx conf to deploy wordpress with docker
# nginx-conf/nginx.conf
server {
listen 80;
listen [::]:80;
server_name localhost;
index index.php index.html index.htm;
@pararang
pararang / indonesian_locations.json
Last active February 14, 2024 12:06
Gist ini berisi file JSON yang memuat daftar lokasi di Indonesia, mulai dari tingkat desa hingga provinsi. Struktur data disusun hierarkis, di mana level yang lebih tinggi akan membungkus daftar lokasi yang ada di bawahnya. Data ini diperoleh melalui proses scraping dari website Komisi Pemilihan Umum (KPU) pada Pemilu 2024 menggunakan endpoint-e…
This file has been truncated, but you can view the full file.
[
{
"nama": "ACEH",
"id": 100054,
"kode": "11",
"tingkat": 1,
"kota_kabupaten": [
{
"nama": "ACEH BARAT",
"id": 191126,
@pararang
pararang / System Design.md
Created March 31, 2023 03:21 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@pararang
pararang / script-listing-image-files.py
Last active June 1, 2020 00:48
recursively read the contents of the directory and write the names of the image files found in the directory/subdirectories then write the file name into the text document
import os
my_list = ""
directory_list = os.listdir()
with open("selected-images.txt", "w", encoding="utf-8") as file:
for dir in directory_list:
if os.path.isdir(dir) == False:
continue
my_list += '------ START OF ' + dir + " ------\n"
for eachfile in os.listdir(dir):
if eachfile.lower().endswith(('.png', '.jpg', '.jpeg')) == False:
@pararang
pararang / Response.php
Last active December 5, 2019 10:49 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;