Skip to content

Instantly share code, notes, and snippets.


Rizky Syazuli rizkysyazuli

View GitHub Profile
rizkysyazuli /
Last active Aug 7, 2020
US States & Cities select menu


What is this?

Example JS for populating select menus with US states and the all the cities in it. The city select will be updated based on the selected state.

Data source

rizkysyazuli /
Last active Apr 12, 2020
[Shell - File Management] Files management utilities #shell
# a typical rsync file transfer upload command
rsync -uavl --exclude-from='exclude-list.txt' --delete ./ user@host:/upload/path
# rsync copy folders
rsync -avzh --exclude=dir/ /source /destination/
# rsync download remote directory
rsync -avzh user@host:/target/path ./destination
rizkysyazuli /
Last active Mar 6, 2020
[Shell - Git Commands] Obscure but useful Git commands #git #shell
# check repo size
git count-objects -vH
# clone a mirror copy of a repo
git clone --mirror <repo-url>
# git merge dry run
git merge --no-commit --no-ff branch_name
rizkysyazuli /
Last active Nov 4, 2020
[Shell - Nginx Commands] #nginx #centos #ubuntu
# Start
sudo systemctl start nginx
sudo service nginx start
# Stop
sudo systemctl stop nginx
sudo service nginx stop
# Restart
sudo systemctl restart nginx
rizkysyazuli /
Last active Feb 21, 2020
[Shell - Apache Commands] #ubuntu #centos #apache
# Ubuntu
sudo service apache2 start
sudo service apache2 stop
sudo service apache2 restart
# CentOS 7.x or newer
sudo systemctl start httpd.service
sudo systemctl stop httpd.service
sudo systemctl restart httpd.service
rizkysyazuli /
Last active Apr 16, 2020
[Shell - Utilities] Useful Linux shell commands & utilities #shell #unix
# check active services
ps aux | grep 'service_name'
# check unix OS
cat /etc/os-release
lsb_release -a # might not work in every distro
# Connect to OpenVPN
rizkysyazuli / .editorconfig
Last active Feb 20, 2020
[Dotfiles - WP Theme Dev Settings] Contains rules for EditorConfig, stylelint, ESLint, and PHP_CodeSniffer that follows WordPress coding standards. Uses and Gulp + BrowserSync for auto reload. #wordpress #development #linter #dotfiles
View .editorconfig
# EditorConfig is awesome:
root = true
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
rizkysyazuli / idr-check.js
Last active Feb 21, 2020
[Bookmarklet -] Get estimate values of your crypto currency portfolio in Rupiah. Probably no longer works. #bookmarklets
View idr-check.js
* Author: Rizky Syazuli <>
* This code snippet is used to show live IDR estimate of your crypto assets in
* Used as a bookmarklet. Go here to do convert any JS snippets into a bookmarklet:
if (window.location.href !== '') {
alert(`Your're not in VIP spot market page`);
rizkysyazuli /
Last active Feb 20, 2020
[Shell - Server Log to Slack] Sends server log entries to Slack via webhook #webhook #slack #apache #nginx #shell
tail -n0 -F "$1" | while read LINE; do
(echo "$LINE" | grep -e "$3") && curl -X POST --silent --data-urlencode \
"payload={\"text\": \"$(echo $LINE | sed "s/\"/'/g")\"}" "$2";
# to monitor a single session
# ./ "/var/log/nginx/access-web.log" "" " 500 "
#!/usr/bin/env bash
# Originally from:
# Install Ruby Version Manager (RVM)
# gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
# curl -sSL | bash -s stable --ruby=2.1
# rvm use 2.1 --default
# Essentials