Skip to content

Instantly share code, notes, and snippets.

View bastomiadi's full-sized avatar

Bastomi Adi Nugroho bastomiadi

View GitHub Profile
@bastomiadi
bastomiadi / fcm-v1.php
Created June 19, 2024 09:58
FCM Firebase V1 Example With PHP Backend
<?php
function getAccessToken($serviceAccountPath) {
$now = time();
$payload = [
"iss" => $serviceAccountPath['client_email'],
"sub" => $serviceAccountPath['client_email'],
"aud" => "https://oauth2.googleapis.com/token",
"iat" => $now,
"exp" => $now + 3600,
@bastomiadi
bastomiadi / gist:9539e7aa6f4ea186862e5ef948cd4764
Created March 13, 2022 04:40
Fonts CJK Alternative size lebih kecil untuk Arch
yay -S ttf-tw wqy-microhei wqy-zenhei ttf-arphic-ukai opendesktop-fonts wqy-bitmapfont ttf-hannom otf-ipafont ttf-vlgothic ttf-mplus ttf-monapo ttf-sazanami ttf-nanum ttf-nanumgothic_coding
@bastomiadi
bastomiadi / post-installation-void-linux-glibc.txt
Last active December 9, 2024 15:00
Post installation Void Linux (Glibc)
1. Update all package system
sudo xbps-install -Suv
2. add non-free repo
sudo xbps-install -Rs void-repo-nonfree
3. Software & utilities
sudo xbps-install -Rs xdg-desktop-portal xdg-desktop-portal-gtk xdg-user-dirs xdg-user-dirs-gtk xdg-utils vlc pipewire libspa-bluetooth noto-fonts-cjk noto-fonts-emoji noto-fonts-ttf noto-fonts-ttf-extra libreoffice-writer libreoffice-calc libreoffice-impress rhythmbox neofetch ntfs-3g gimp inkscape lm_sensors wget udisks2 gvfs mtpfs gvfs-mtp gvfs-gphoto2 xtools WoeUSB xz unrar qt5-wayland nano ffmpeg Kooha handbrake inxi streamlink
4. Install chrome gnome, gnome menu For Gnome & extension
@bastomiadi
bastomiadi / lamp-on-void-linux.md
Created September 13, 2021 14:39 — forked from adnan360/lamp-on-void-linux.md
Instructions on how to install LAMP on Void Linux for easier PHP development

How to install LAMP in Void Linux

To install LAMP (Linux, Apache, MySQL/MariaDB, PHP) on Void Linux, follow these steps below.

NOTE: This has been prepared for ease of use in mind, not security. Please do not use these instructions to setup on a public server environment. Use other proper manuals instead.

Install the things we need:

@bastomiadi
bastomiadi / 0-preface.md
Created June 1, 2021 02:21 — forked from ianmustafa/0-preface.md
Tantangan PHP Indonesia for Student: Algoritma Homing Pigeon

Tantangan PHP Indonesia for Student: Algoritma Homing Pigeon

Sebelumnya, terima kasih kepada om Nur Hidayat (@hidayat365, Pojok Programmer) untuk tantangannya di grup Telegram PHP Indonesia for Students. Tantangan ini kembali mengingatkan saya bahwa overthinking itu tidak perlu. 😂

Latar Belakang

Ada seorang raja kaya memiliki wilayah kekuasaan yang luas sedang berburu sendirian, namun sayang tak sengaja dia terpelesat dan kakinya terkilir. Untungnya dia membawa seekor merpati, sehingga dikirimlah merpati itu kembali ke istana untuk meminta bantuan.

@bastomiadi
bastomiadi / 0-preface.md
Created June 1, 2021 02:21 — forked from ianmustafa/0-preface.md
Tantangan PHP Indonesia for Student: Cari Bilangan Duplikat dalam List

Tantangan PHP Indonesia for Student: Cari Bilangan Duplikat dalam List

Sebelumnya, terima kasih kepada om Nur Hidayat (@hidayat365, Pojok Programmer) untuk tantangannya di grup Telegram PHP Indonesia for Students. Tantangan ini saya kerjakan karena iseng dan nungguin deploy app. 😂

Latar Belakang

Misalkan kita mempunyai list berisikan bilangan bulat antara 1 sampai n sebanyak n + 1 angka. Yang pasti kita ketahui adalah minimal ada satu bilangan yang duplikat dalam list tersebut.

Contohnya jika n = 3 maka bisa jadi isi List tersebut adalah 3, 1, 1, 3 atau bisa juga 1, 2, 3, 3.

@bastomiadi
bastomiadi / 0-preface.md
Created June 1, 2021 02:17 — forked from ianmustafa/0-preface.md
PHP: cURL vs file_get_contents

PHP: cURL vs file_get_contents()

This is a very often asked question among PHP developers. This gist aims to answer it.

Case study

RajaOngkir API.

Benchmark

  • Done in DigitalOcean, cheapest droplet ($5), located in Singapore, using Ubuntu Server 18.04.3. (Referral link for anybody interested.)
  • System configured with (mostly) default configuration, using what's available from the package installation.

Prepare Your Linux Server

What Does This Really Do?

Basically we set up the timezone and locale, and only allow for SSH root login without password, by using SSH authentication key. We also add a basic Vim conviguration inside .vimrc by adding line numbers by default.

Then we update the repository and the system, and also add basic tools like nano, curl, tmux, even vim itself doesn't included by the system. zsh and git is prequisites for oh-my-zsh,

@bastomiadi
bastomiadi / History\-109374a\entries.json
Last active April 4, 2023 03:13
vscode-settings-sync
{"version":1,"resource":"file:///d%3A/Bastomi/Projects/docker/www/php74/yii_kuesioner/common/models/QuestionAnswerGroup.php","entries":[{"id":"msYY.php","timestamp":1657158344638},{"id":"uNoS.php","timestamp":1657176875505},{"id":"f2G4.php","timestamp":1657176893797},{"id":"MzSY.php","timestamp":1657176920109},{"id":"RvKm.php","timestamp":1657176930385},{"id":"HUXY.php","timestamp":1657176943847},{"id":"mt83.php","timestamp":1657177359360},{"id":"EXIK.php","source":"undoRedo.source","timestamp":1657177371406},{"id":"5Bm1.php","timestamp":1657177895123},{"id":"ipR3.php","source":"undoRedo.source","timestamp":1657177938012},{"id":"s9R9.php","timestamp":1657711992758},{"id":"lUsK.php","timestamp":1657772789563}]}