Skip to content

Instantly share code, notes, and snippets.

View sutandang's full-sized avatar

eringga sutandang

  • indonesia
  • yogyakarta , indonesia
View GitHub Profile
@sutandang
sutandang / wordpress.nginxconf
Created November 15, 2021 00:09 — forked from goblindegook/wordpress.nginxconf
Nginx virtual host configuration for WordPress
server {
listen 80;
server_name www.example.com;
rewrite ^ $scheme://example.com$request_uri?;
}
server {
listen 80;
server_name example.com;
@sutandang
sutandang / gist:70cf506027837654a94ca0ccdc54f10c
Created December 18, 2019 03:01
docker composer for wordpress mysql and phpmyadmin
version: '3'
services:
# Database
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
@sutandang
sutandang / import.md
Created November 12, 2019 16:01 — forked from iamstoick/import.md
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@sutandang
sutandang / commit_format_examples.txt
Created September 4, 2019 15:29 — forked from mutewinter/commit_format_examples.txt
Examples of my commit format.
chore: add Oyster build script
docs: explain hat wobble
feat: add beta sequence
fix: remove broken confirmation message
refactor: share logic between 4d3d3d3 and flarhgunnstow
style: convert tabs to spaces
test: ensure Tayne retains clothing
$ cd /<wherever>/Sites/<thesite>
$ sudo chown -R _www wordpress
$ sudo chmod -R g+w wordpress
## Batch update permission
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
@sutandang
sutandang / wp-config.php
Created September 5, 2018 07:06
Set WordPress site URL in the config file instead of the database
<?php
// WordPress stores the site URL in the database by default (which I have never
// understood), and it's a pain to have to type out the UPDATE SQL or search in
// phpMyAdmin to change it. This is a simple way to put the URL into
// wp-config.php instead.
// Note that you will still need to update any URLs that appear in the content,
// especially when you copy a database from a development site to production:
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5
@sutandang
sutandang / Undo Changes
Created August 27, 2018 03:53 — forked from warolv/Undo Changes
Undo Changes
git reset --soft HEAD^ -> undo last commit and save changes
git reset --hard HEAD~1 -> undo last commit and remove changes
git reset --hard HEAD~2 -> undo 2 last commits and remove changes
git revert commit-hash -> create new commit which reverts last commit
git checkout . -> remove all uncommitted changes
git checkout filename -> undo changes in specific file
git clear -df -> remove all untracked files
git rm filename -> remove file from index, after your did git add filename
git commit --amend -> change message of last commit
@sutandang
sutandang / remote_url.md
Created August 27, 2018 03:27 — forked from hofnerb/remote_url.md
git remote set-url

Review and Change Remote URL

git remote -v
# View existing remotes

git remote set-url origin https://github.com/user/repo2.git
# Change the 'origin' remote's URL

git remote -v
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@sutandang
sutandang / .gitignore
Created August 27, 2018 03:03 — forked from salcode/.gitignore
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore