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
.ratio-image { | |
position: relative; | |
height: 0; | |
padding-bottom: 100%; | |
img { | |
max-width: 100%; | |
position: absolute; | |
top: 0; | |
bottom: 0; |
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
@keyframes scale-x-zero-to-max { | |
0% { | |
transform: scaleX(0); | |
} | |
100% { | |
transform: scaleX(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
//https://towardsdatascience.com/quickly-extract-all-links-from-a-web-page-using-javascript-and-the-browser-console-49bb6f48127b | |
var x = document.querySelectorAll("a"); | |
var myarray = [] | |
for (var i=0; i<x.length; i++){ | |
var nametext = x[i].textContent; | |
var cleantext = nametext.replace(/\s+/g, ' ').trim(); | |
var cleanlink = x[i].href; | |
myarray.push([cleantext,cleanlink]); | |
}; | |
function make_table() { |
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
/* | |
If you ever see your characters , specially ' and "" converted to ’ this type of characters, this may help you. | |
*/ | |
$string = "Buyer’s Agent"; | |
echo iconv ( 'UTF-8', 'macintosh', $string ); |
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
@DATABASE@__%Y-%m-%d_%H-%M-%S |
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
history.pushState("", document.title, window.location.pathname + window.location.search); |
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 | |
if (!is_admin()) { | |
// default URL format | |
if (preg_match('/author=([0-9]*)/i', $_SERVER['QUERY_STRING'])) die(); add_filter('redirect_canonical', 'shapeSpace_check_enum', 10, 2); | |
} | |
function shapeSpace_check_enum($redirect, $request) { | |
// permalink URL format | |
if (preg_match('/\?author=([0-9]*)(\/*)/i', $request)) die(); else return $redirect; | |
} |
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://www.youtube.com/watch?v=DkxMhdtOnKM'; | |
preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match); | |
$youtube_id = $match[1]; | |
$image_url = 'https://img.youtube.com/vi/'.$youtube_id.'/maxresdefault.jpg'; | |
echo $image_url; |
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
// Discard spam comments while showing spammer it's processed. | |
add_filter( 'gpb_enable_honeypot', '__return_true' ); |
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 | |
/* | |
Template Name: Redirect To First Child | |
*/ | |
if (have_posts()) { | |
while (have_posts()) { | |
the_post(); | |
$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order"); | |
$firstchild = $pagekids[0]; | |
wp_redirect(get_permalink($firstchild->ID)); |
NewerOlder