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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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 | |
# Problem :Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES | |
# Solution 1: --single-transaction | |
# Solution 2: GRANT SELECT,LOCK TABLES ON DBNAME.* TO 'root'@'localhost'; | |
echo "****************************************"; | |
echo "* Backup All Databases *"; |
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
SELECT DBName,CONCAT(LPAD(FORMAT(SDSize/POWER(1024,pw),3),17,' '),' ', | |
SUBSTR(' KMGTP',pw+1,1),'B') "Data Size",CONCAT(LPAD( | |
FORMAT(SXSize/POWER(1024,pw),3),17,' '),' ',SUBSTR(' KMGTP',pw+1,1),'B') "Index Size", | |
CONCAT(LPAD(FORMAT(STSize/POWER(1024,pw),3),17,' '),' ', | |
SUBSTR(' KMGTP',pw+1,1),'B') "Total Size" FROM | |
(SELECT IFNULL(DB,'All Databases') DBName,SUM(DSize) SDSize,SUM(XSize) SXSize, | |
SUM(TSize) STSize FROM (SELECT table_schema DB,data_length DSize, | |
index_length XSize,data_length+index_length TSize FROM information_schema.tables | |
WHERE table_schema NOT IN ('mysql','information_schema','performance_schema')) AAA | |
GROUP BY DB WITH ROLLUP) AA,(SELECT 2 pw) BB ORDER BY (SDSize+SXSize); |
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 | |
// get next and prev products | |
// Author: Georgy Bunin ([email protected]) | |
// forked from https://gist.github.com/2176823 | |
function ShowLinkToProduct($post_id, $categories_as_array, $label) { | |
// get post according post id | |
$query_args = array( 'post__in' => array($post_id), 'posts_per_page' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'tax_query' => array( | |
array( | |
'taxonomy' => 'product_cat', |
NewerOlder