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
var regex = /<a(.+?(?=href))href="((http|https):\/\/(?!www.techmuzz.com)[\w\.\/\-=?#]+)"(.*?)>(.*?)<\/a>/g; | |
var replaceAnchor = '<a$1href="$2"$4>$5 <img src="https://techmuzz.com/favicon.ico"></a>'; | |
var htmlElement = jQuery('.entry-content'); | |
var updatedHtml = htmlElement.html().replace(regex, replaceAnchor); | |
htmlElement.replaceWith(updatedHtml); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE policymap [ | |
<!ELEMENT policymap (policy)+> | |
<!ELEMENT policy (#PCDATA)> | |
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED> | |
<!ATTLIST policy name CDATA #IMPLIED> | |
<!ATTLIST policy rights CDATA #IMPLIED> | |
<!ATTLIST policy pattern CDATA #IMPLIED> | |
<!ATTLIST policy value CDATA #IMPLIED> | |
]> |
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
#Given an integer, , perform the following conditional actions: | |
#If is odd, print Weird | |
#If is even and in the inclusive range of to , print Not Weird | |
#If is even and in the inclusive range of to , print Weird | |
#If is even and greater than , print Not Weird | |
#Complete the stub code provided in your editor to print whether or not is weird. | |
defmodule Solution do |
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 | |
$excerpt = get_the_excerpt(); | |
$categories = get_the_category(); | |
$cat = ""; | |
$flag1=false; | |
$flag2=false; | |
if ( ! empty( $categories ) ) { | |
$cat=esc_html( $categories[0]->name ); | |
echo "Category=".$cat."</br>"; | |
if($cat == "News"){ |
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 publishPost($title,$description,$category,$keywords,$encoding,$excerpt) | |
{ | |
$content = array( | |
'title'=>$title, | |
'description'=>$description, | |
'mt_allow_comments'=>0, // 1 to allow comments | |
'mt_allow_pings'=>0, // 1 to allow trackbacks |
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 TM_add_to_post_content($content) { | |
if (is_single()) { | |
$content .= '<div style="text-align:right;width:700px;font-size:15px;clear:both;margin-bottom:10px;"><a style="text-decoration:none;color:#999;" title="Report an Error" href="http://www.techmuzz.com/report-an-error/">Report an Error</a></div>'; | |
} | |
return $content; | |
} | |
add_filter ('the_content', 'TM_add_to_post_content', 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
<script> | |
if (navigator.getBattery) { | |
navigator.getBattery().then(function(battery) { | |
display(battery); | |
}); | |
} else if (navigator.battery) { | |
display(navigator.battery); | |
} else { | |
console.log("Sorry, Battery Status API is not supported"); |
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
<script> | |
(function () { | |
var width = 0, | |
flipboard = document.getElementById('flipboard'); | |
width = flipboard.getBoundingClientRect().width ? flipboard.getBoundingClientRect().width : flipboard.offsetWidth; | |
if (width > 800) { | |
flipboard.innerHTML = '<iframe width="100%" frameborder="0" height="600px" marginheight="0" marginwidth="0" scrolling="no" src="https://flipboard.com/section/the-internet-of-things-bn8l9H"></iframe>' | |
} | |
})(); | |
</script> |
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 | |
//* Do NOT include the opening php tag | |
//* Enqueue scripts and styles | |
add_action( 'wp_enqueue_scripts', 'custom_scripts_styles_mobile_responsive' ); | |
function custom_scripts_styles_mobile_responsive() { | |
wp_enqueue_script( 'beautiful-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); | |
wp_enqueue_style( 'dashicons' ); |
NewerOlder