Skip to content

Instantly share code, notes, and snippets.

View miftahafina's full-sized avatar
🏠
Work from heaven

Miftah Afina miftahafina

🏠
Work from heaven
View GitHub Profile
let ucwords = (str) => {
return str.toLowerCase()
.split(' ')
.map((x) => x.slice(0, 1).toUpperCase() + x.slice(1, x.length))
.join(' ');
}
let tes = ucwords("loReM iPsum DolOr SIt aMet");
console.log(tes); // result: "Lorem Ipsum Dolor Sit Amet"
@miftahafina
miftahafina / Setup LEMP.txt
Created October 30, 2018 08:18
Setup LEMP
Setup droplet
# create droplet
# setup private network
Edit via DO Dashboard
https://www.digitalocean.com/docs/networking/private-networking/how-to/enable/#ubuntu-16-04
# initial setup (including firewall)
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
@miftahafina
miftahafina / konfigurasi-droplet.txt
Last active November 10, 2019 04:01
Install Droplet Ubuntu 16.04
Setup droplet
# create droplet ubuntu 16.04
# setup private network
Edit via DO Dashboard
https://www.digitalocean.com/docs/networking/private-networking/how-to/enable/#ubuntu-16-04
# initial setup (including firewall)
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04

AWS EC2, Ubuntu 16.04, PHP 7.1, NGINX, Laravel 5.5, MariaDB 10.2, Composer

DISCLAIMER: I will avoid using generic keywords so that you're forced to name things yourself:

test, example, default, key, 10.174.75.99

latvija, pupper, elvisoctp, ilunimati-top-security, 10.10.10.1000000000
@miftahafina
miftahafina / EasternArabic.php
Last active November 14, 2019 08:38
#Helper - Convert from western to eastern arabic numeral
<?php
namespace app\Helpers;
class EasternArabic
{
public static function convert($number, $process = false)
{
if ($process) {
$western = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.'];
Notes:
- Disable ufw
or
sudo ufw allow 19000/tcp
sudo ufw allow 19001/tcp
sudo ufw reload
ref
@miftahafina
miftahafina / things.txt
Last active July 18, 2020 15:16
Things you should do after installing Ubuntu 20.04
Install zsh
Install chrome
Install gnome shell integration for chrome
https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep/related
sudo apt install gnome-tweaks
Install dash to panel gnome extension
@miftahafina
miftahafina / after-install-ubuntu-20-04.txt
Last active May 29, 2022 01:39
After Installing Ubuntu 20.04
# update repo
sudo apt update
sudo apt dist-upgrade
# install zsh
sudo apt install zsh
sudo apt install git-core
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
chsh -s `which zsh`
sudo shutdown -r 0
@miftahafina
miftahafina / 51-usb-device.rules
Created January 10, 2021 13:27
Wiimote Wii remote wii motion plus on ubuntu
# https://www.gamingonlinux.com/forum/topic/3247/
# https://github.com/dolphin-emu/dolphin/blob/master/Data/51-usb-device.rules
# dir /etc/udev/rules.d/
#GameCube Controller Adapter
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", TAG+="uaccess"
#Wiimotes or DolphinBar
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0306", TAG+="uaccess"
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0330", TAG+="uaccess"