Skip to content

Instantly share code, notes, and snippets.

View woraperth's full-sized avatar
🏠
Working from home

Perth Ngarmtrakulchol woraperth

🏠
Working from home
View GitHub Profile
@woraperth
woraperth / foundaton-es5.js
Created March 9, 2016 09:45
Foundation 6 ES5 version for Essential Download (Fixing "class is a reserved identifier" problem)
'use strict';
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
!(function ($) {
'use strict';
@woraperth
woraperth / Movefile
Created November 18, 2015 14:47
Working Movefile for Wordmove with SSH (MAMP to DigitalOcean)
local:
vhost: "http://localhost/xxx"
wordpress_path: "/Applications/MAMP/htdocs/xxx" # use an absolute path here
database:
name: "xxx"
user: "root"
password: "root"
host: "localhost"
<?php
/* Original Script from: http://stackoverflow.com/questions/1294117/how-to-change-collation-of-database-table-column */
/* Note: This script will loop through all the tables and change collation to utf8_general_ci
But it will not change database's collation. The only way to change database collation might be to delete and create it again.
/*
$con = mysql_connect('localhost','db_user','db_pass'); /* Edit DB Username / Password */
if(!$con) { echo "Cannot connect to the database ";die();}
mysql_select_db('db_name'); /* Edit DB Name */
$result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
# ---- DB Search-Replace and Backup Script ----
# Note: This requires WP-CLI to be installed http://wp-cli.org/
#
# This will generate new SQL file for import to new URL
# 1. Old DB - for Backup purpose (old URL): backup-yymm.sql
# 2. Replaced DB - ready for deploy (new URL): replaced-yymm.sql
#
# Replace aaa.com to bbb.com in the script below
#
# Note: Sometimes you need to change permission with