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
/* HTTP */ | |
UPDATE wp_options SET option_value = replace(option_value, 'http://OLDDOMAIN.com', 'http://NEWDOMAIN.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://OLDDOMAIN.com','http://NEWDOMAIN.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://OLDDOMAIN.com', 'http://NEWDOMAIN.com'); | |
/* HTTP + WWW */ | |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.OLDDOMAIN.com', 'http://NEWDOMAIN.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.OLDDOMAIN.com','http://NEWDOMAIN.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.OLDDOMAIN.com', 'http://NEWDOMAIN.com'); |
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
@mixin for-phone-only { | |
@media (max-width: 599px) { @content; } | |
} | |
@mixin for-tablet-portrait-up { | |
@media (min-width: 600px) { @content; } | |
} | |
@mixin for-tablet-portait-only { | |
@media (min-width: 600px) and (max-width: 899px) { @content; } | |
} | |
@mixin for-tablet-landscape-up { |
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
/* Breakpoints */ | |
/* ------------------------- Source: http://blog.scur.pl/2012/06/variable-media-queries-less-css/ */ | |
@highdensity: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5)", | |
~"only screen and (min--moz-device-pixel-ratio: 1.5)", | |
~"only screen and (-o-min-device-pixel-ratio: 3/2)", | |
~"only screen and (min-device-pixel-ratio: 1.5)"; | |
@mobile: ~"only screen and (max-width: 529px)"; | |
@tablet: ~"only screen and (min-width: 530px) and (max-width: 949px)"; | |
@desktop: ~"only screen and (min-width: 950px) and (max-width: 1128px)"; | |
@desktop-xl: ~"only screen and (min-width: 1129px)"; |
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
order deny,allow | |
deny from all | |
allow from 127.0.0.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
javascript:(function(){let best=parseInt(prompt("Your best case scenario : ", "1000"), 10),amt=(((best*8)+(best)+(best*6))/6);alert('Total estimate: '+amt);})(); | |
/* Here it is laid out: */ | |
(function(){ | |
let best=parseInt(prompt("Your best case scenario : ", "1000"), 10), | |
amt=(((best*8)+(best)+(best*6))/6); | |
alert('Total estimate: ' + amt); | |
})(); |
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
/** | |
* Is blog page | |
* | |
*/ | |
function is_blog() { | |
return ( (is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag()) ) ? true : false ; | |
} |
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 | |
/** | |
* Clip blog post excerpts | |
* | |
*/ | |
add_filter('get_the_excerpt','excerpt_char_limit'); | |
function excerpt_char_limit($e){ | |
return substr($e,0,150) . '…'; | |
} |
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
/** | |
* Vertical Align (Mixins) | |
* | |
*/ | |
.vertical-align(@position: relative, @offset: 50%) { | |
top: @offset; | |
position: @position; | |
-webkit-transform: translateY(-@offset); | |
-ms-transform: translateY(-@offset); | |
transform: translateY(-@offset); |
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
let ppokes = $$('._xco ._42us a');for(ppoke in ppokes){ document.writeln(ppokes[ppoke].innerHTML + ', '+ ppokes[ppoke].href +'<br>' ); }; |
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
## Delete duplicate WooCommerce products | |
## (Retains the lowest ID) | |
## Pro tip: Change to SELECT to test | |
DELETE bad_rows.* | |
from wp_posts as bad_rows | |
inner join ( | |
select post_title, MIN(id) as min_id | |
from wp_posts | |
where post_type = 'product' |
OlderNewer