- Stop mysql server
- Copy contents of datadir to another location on disk (~/mysqldata/*)
- Start mysql server again (downtime was 10-15 minutes)
- compress the data (tar -czvf mysqldata.tar.gz ~/mysqldata)
- copy the compressed file to new server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script will remove all node modules | |
# | |
# Author: Lafif Astahdziq | |
# https://lafif.me | |
# | |
FOLDER_ROOT=${1:-.} # default to current directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require('laravel-mix'); | |
const url = 'http://lab.tinypixel.test'; | |
const app = './src'; | |
const config = './config'; | |
const resources = './resources'; | |
const assets = './resources/assets'; | |
const dist = './dist'; | |
const externals = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use it with `goto project` | |
goto () { | |
# cancel if no arguments | |
if [ -z "$1" ]; then | |
echo "Mau goto kemana??" | |
return 0 | |
fi | |
local UPPER=$(printf "%s" "$1" | tr '[:lower:]' '[:upper:]'); | |
local P_DIR="/Users/qutek/LocalServer/_$UPPER"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Auto login user without password, access with <code>http://domain.com/?force_login=username</code> | |
* [email protected] | |
*/ | |
if ( ! defined( 'WP_CLI' ) ) { | |
function force_login() { | |
if( !isset($_GET[ 'force_login' ]) || empty( $_GET[ 'force_login' ] ) ) | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Debug Email | |
* Description: Simple script to change all email recipients for debugging / development purpose | |
* Version: 0.1 | |
* Author: Lafif Astahdziq | |
* Author URI: https://lafif.me | |
*/ | |
add_action( 'init', 'test_send_email' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculate stripe fee from amount | |
* so you can charge stripe fee to customers | |
* lafif <[email protected]> | |
*/ | |
var fees = { | |
USD: { Percent: 2.9, Fixed: 0.30 }, | |
GBP: { Percent: 2.4, Fixed: 0.20 }, | |
EUR: { Percent: 2.4, Fixed: 0.24 }, | |
CAD: { Percent: 2.9, Fixed: 0.30 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert object to array | |
* @param [type] $obj [description] | |
* @return [type] [description] | |
*/ | |
function obj_to_array($obj) { | |
if(!is_array($obj) && !is_object($obj)) | |
return $obj; | |