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 <field_name>, COUNT(*) c FROM <table> GROUP BY <field_name> HAVING c > 1; |
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
| -- Replace %s with table prefix | |
| DELETE tr | |
| FROM %s_term_relationships tr | |
| INNER JOIN %s_term_taxonomy tt | |
| ON (tr.term_taxonomy_id = tt.term_taxonomy_id) | |
| WHERE tt.taxonomy != 'link_category' | |
| AND tr.object_id NOT IN (SELECT ID FROM %s_posts); |
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
| UPDATE data_table t, (SELECT DISTINCT ID, NAME, VALUE | |
| FROM data_table | |
| WHERE VALUE IS NOT NULL AND VALUE != '') t1 | |
| SET t.VALUE = t1.VALUE | |
| WHERE t.ID = t1.ID | |
| AND t.NAME = t1.NAME |
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
| function elementInViewport(el) { | |
| var rect = el.getBoundingClientRect() | |
| return rect.top < (window.innerHeight || document.body.clientHeight) && rect.left < (window.innerWidth || document.body.clientWidth); | |
| } | |
| // and then you can use it: | |
| alert(elementInViewport(document.getElementById('inner'))); | |
| // or | |
| alert(elementInViewport($('#inner')[0])); | |
| ` |
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
| glob:.hgignore | |
| glob:.htaccess | |
| glob:.htpasswd | |
| glob:wp-config.php | |
| glob:wp-content/uploads/* |
NewerOlder