Skip to content

Instantly share code, notes, and snippets.

View muhammadyana's full-sized avatar
🏠
Work From Anywhere

Muhammad Yana Mulyana muhammadyana

🏠
Work From Anywhere
View GitHub Profile
@muhammadyana
muhammadyana / install-postgresql-on-mac.md
Last active March 28, 2023 23:03
Install postgresql in mac using homebrew
brew install postgresql@14
brew services start postgresql@14
psql postgres

# Optional
cd /usr/local/var/
rm -rf postgres
initdb /usr/local/var/postgres
@muhammadyana
muhammadyana / deploy_react_with_ec2_capistrano.MD
Last active July 22, 2022 03:32
Deploying React Application to Amazon EC2 with Capistrano, Github Action & Nginx

INSTALL NODE JS & YARN

Install NVM

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc

Install node js 14

@muhammadyana
muhammadyana / setup-rails-in-ubuntu-server.md
Last active June 28, 2022 10:45
Setup ruby on rails and required in ubuntu

INSTALL ZSH

sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
@muhammadyana
muhammadyana / Activate Office 2019 for macOS VoL.md
Created June 16, 2022 20:00 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@muhammadyana
muhammadyana / README.md
Created April 16, 2022 16:32 — forked from danirod/README.md
nginx + systemd + puma
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import ElementClickInterceptedException, NoSuchElementException
from time import sleep
from selenium.common.exceptions import NoSuchElementException
EMAIL = "email@quipper.com"
PASSWORD = "password"
@muhammadyana
muhammadyana / rails_model_bes_practice.rb
Created February 22, 2022 03:17
Rails model best practice
# Extends ...................................................................
# Includes ..................................................................
# Variables .................................................................
# Fields (If use mongo) .....................................................
# Relationships .............................................................
# Validations ...............................................................
# Callbacks .................................................................
# Scopes ....................................................................
# Uploaders .................................................................
# Additional config (i.e. accepts_nested_attributes_for etc...) .............
@muhammadyana
muhammadyana / clean_code.md
Created February 22, 2022 03:16 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@muhammadyana
muhammadyana / rails http status codes
Created February 15, 2022 06:18 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@muhammadyana
muhammadyana / app.DockerFile
Created January 28, 2022 11:10 — forked from satendra02/app.DockerFile
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran: