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 td_mobile_menu_toogle() { | |
jQuery('#td-top-mobile-toggle a, .td-mobile-close a').click(function(e) { | |
if (jQuery('body').hasClass('td-menu-mob-open-menu')) { | |
jQuery('body').removeClass('td-menu-mob-open-menu'); | |
} else { | |
jQuery('body').addClass('td-menu-mob-open-menu'); | |
} | |
e.preventDefault(); | |
}); | |
jQuery(document).find('#td-mobile-nav .menu-item-has-children').each(function(i) { |
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
/** | |
* Disable zxcvbn.min.js on WordPress loading | |
*/ | |
function deregister_or_dequeue_scripts() { | |
wp_dequeue_script('wc-password-strength-meter'); | |
} | |
add_action('wp_print_scripts', 'deregister_or_dequeue_scripts', 20); |
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 | |
add_filter('autoptimize_filter_cache_getname', 'pushAOFiles'); | |
function pushAOFiles($in) { | |
$pushType = substr($in, strrpos($in, ".") + 1) === "js" ? "script" : "style"; | |
// Do not push CSS files if it is already inline. | |
if ($pushType == "style" && ((bool)get_option("autoptimize_css_inline", true))) return; |
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
#!/bin/bash | |
# | |
# Written by AC - 2015 <[email protected]> - sys0dm1n.com | |
# | |
URL=$1 | |
wget --quiet http://$URL/sitemap.xml --no-cache --output-document - | egrep -o "http(s?)://$URL[^ \"\'()\<>]+" | while read line; do | |
if [[ $line == *.xml ]] | |
then | |
newURL=$line |
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 ( is_category( array(1, 2, 3) ) ) { | |
// Do something | |
} else { | |
// Do something else | |
} |
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
#!/bin/bash | |
# Your DDNS hostname or static IP | |
HOSTNAME="xxx.xxx.xxx.xxx" | |
# Username on source server | |
USER="root" | |
# Your camera MAC address | |
CAMERA_MAC="7811DCCCXXXX" | |
DATE=`/bin/date +%Y%m%d%H` |
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 php:5.6-apache | |
RUN a2enmod rewrite | |
# install the PHP extensions we need | |
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev && rm -rf /var/lib/apt/lists/* \ | |
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ | |
&& docker-php-ext-install gd | |
RUN docker-php-ext-install mysqli | |
RUN docker-php-ext-install pdo php_pdo |
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
#!/bin/bash | |
DOMAIN=$1 | |
scan_sitemap () { | |
[ -z "$1" ] && URL="https://$DOMAIN/sitemap.xml" || URL=$1 | |
curl -L --compressed $URL 2>/dev/null | grep -Eo "http(s?):\/\/$DOMAIN[^ \"\'()\<>]+" | while read line; do | |
if [[ $line = *.xml ]] | |
then | |
echo "👉 Sitemap $line" |
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 ('loading' in document.createElement('img')) { | |
document.querySelectorAll('[loading="lazy"]').forEach(elem => { | |
if (elem.dataset.src) { | |
elem.src = elem.dataset.src; | |
} | |
if (elem.dataset.srcset) { | |
elem.srcset = elem.dataset.srcset; | |
} | |
}) | |
} else { |
This file has been truncated, but you can view the full file.
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
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//datuan.dev/main-sitemap.xsl"?> | |
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<url> | |
<loc>https://datuan.dev/</loc> | |
</url> | |
<url> | |
<loc>https://datuan.dev/backlog/thang-12-kubernetes-azdigi-lvh/</loc> | |
<lastmod>2021-12-06T22:10:46+07:00</lastmod> | |
<image:image> |