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 | |
function imelgrat_remove_hentry($class) | |
{ | |
$class = array_diff($class, array('hentry')); | |
return $class; | |
} | |
add_filter('post_class', 'imelgrat_remove_hentry'); |
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 | |
/** | |
* Find if a Youtube video exists. | |
* | |
* The function fetches response headers from YouTube's oEmbed URL for a given video | |
* and crawls through thenm in order to find whether the video actually exists. | |
* | |
* @link https://imelgrat.me/json-xml/oembed-protocol-embed-videos-news/ | |
* |
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
{ | |
"html": "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/u8Kt7fRa2Wc?feature=oembed\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>", | |
"width": 480, | |
"thumbnail_height": 360, | |
"provider_url": "https://www.youtube.com/", | |
"thumbnail_width": 480, | |
"version": "1.0", | |
"type": "video", | |
"title": "The Expert: Progress Meeting (Short Comedy Sketch)", | |
"height": 270, |
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 | |
/** | |
* Example of the IsValidISBN function. | |
* | |
* @link https://imelgrat.me/php/php-validate-barcode-numbers/ | |
*/ | |
// ISBN assigned to "PHP in a Nutshell" by Paul Hudson, 2005 | |
echo 'Is ISBN "'.$code.'" valid? '. (BarcodeValidator::IsValidISBN('9780596100674') ? 'true' : 'false'); | |
?> |
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
"ios": { | |
"release": { | |
"buildFlag": [ | |
"-UseModernBuildSystem=0" | |
] | |
}, | |
"debug": { | |
"buildFlag": [ | |
"-UseModernBuildSystem=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
/** | |
* AppConfig and Cordova. | |
* | |
* Getting EMM configuration data with the "Cordova Plugin for EMM App Config". | |
* Callback for "deviceready" event. | |
* | |
* @link https://imelgrat.me/phonegap/appconfig-cordova-emm/ | |
* @author Iván Melgrati. | |
*/ | |
function onDeviceReady() { |
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
$.ajax(URL, { | |
success: function(data) { | |
// Do something with the returned data | |
}, | |
error: function() { | |
//Handle error here | |
} | |
}); | |
}); |
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 | |
/** | |
* @author Ivan Melgrati | |
* @copyright 2018 | |
*/ | |
function YouTube_Check_ID($videoID) | |
{ | |
$is_valid = true; |