This file contains 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
// from here https://www.regular-expressions.info/completelines.html | |
^(?=.*?\bfirst_word\b)(?=.*?\bsecond_word\b).*$ |
This file contains 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
var text = "This is your title"; | |
var shortText = jQuery.trim(text).substring(0, 10) | |
.split(" ").slice(0, -1).join(" ") + "..."; |
This file contains 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 | |
$url = "https://endpoint.api"; | |
$username = "username"; | |
$password = "password"; | |
$args = array( | |
'headers' => array( | |
'Authorization' => 'Basic ' . base64_encode( $username . ':' . $password ) | |
) | |
); |
This file contains 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
jQuery('.element').prop('outerHTML'); // return html of element including element itself |
This file contains 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 $index = 0; while (have_posts()) : the_post(); ?> | |
<?php get_template_part('partials/content', get_post_type() != 'post' ? get_post_type() : get_post_format()); ?> | |
<div class="temp-index"><?=$index;?></div> | |
<?php $index++;endwhile; ?> |
This file contains 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
//Remember the ID number of the category (in this case, the number is 55) | |
//Open functions.php file from the active theme | |
//Copy and paste the code and replace “xx” with the category ID (leave the minus sign in the code) | |
function exclude_category($query) { | |
if ( $query->is_home() ) {// set this to "is_archive()" to remove from blog | |
$query->set( 'cat', '-xx' ); | |
} | |
return $query; |
This file contains 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
setTimeout(function(){ | |
var theElements = document.querySelectorAll("#pardot-form select"); // seach all dropdown elements with " #pardot-forms select " | |
for(var i=0; i<theElements.length; i++) { | |
var str = theElements[i].children[0].innerHTML; | |
var res = str.match(/^Select\b (...+).../i); | |
theElements[i].children[0].innerHTML = ''; | |
theElements[i].children[0].innerHTML = res[1]; | |
} |
This file contains 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
$('a[href*="#"]').on('click', function(e) { | |
e.preventDefault() | |
$('html, body').animate( | |
{ | |
scrollTop: $($(this).attr('href')).offset().top, | |
}, | |
500, | |
'linear' | |
) | |
}) |
This file contains 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 add_google_fonts() { | |
wp_enqueue_style( ' add_google_fonts ', 'https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700&display=swap', false ); | |
} | |
add_action( 'wp_enqueue_scripts', 'add_google_fonts' ); |
This file contains 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
wget -r -k -l 7 -p -E -nc -erobots=off --user-agent="Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/5З7.З6 (KHTML, like Gecko) Chrome/60.0.З112.11З Safari/5З7.36" www.lica-center.com.ua | |
-- or if "502 bad gateway" you could try remove user-agent -- |