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 | |
/* | |
* REF: https://shellcreeper.com/move-files-server-to-server-using-simple-php/ | |
*/ | |
// Insert this file on server and go to the path from browser. | |
set_time_limit(0); // Unlimited max execution time | |
/* Source File URL */ | |
$remote_file_url = 'http://origin-server-url/files.zip'; |
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
// If you user jQuery: https://api.jquery.com/jQuery.getScript/ | |
// $.getScript(url, successCallback) | |
$.getScript( "ajax/test.js", function( data, textStatus, jqxhr ) { | |
console.log( data ); // Data returned | |
console.log( textStatus ); // Success | |
console.log( jqxhr.status ); // 200 | |
console.log( "Load was performed." ); | |
}); | |
// Handling Errors |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<title>Multiple Google Map Marker</title> | |
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key="></script> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<script type="text/javascript" src="mapmarker.jquery.js"></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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>Marker Clustering</title> | |
<style> | |
/* Always set the map height explicitly to define the size of the div | |
* element that contains the map. */ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | |
<script> | |
function generateRandomString(length) { | |
var result = ''; | |
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@!#'; | |
var charactersLength = characters.length; | |
for ( var i = 0; i < length; i++ ) { |
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 | |
/* | |
* PHP multidimensional array search ( LIKE SEARCH ) | |
* @since 1.0.0 | |
*/ | |
function searchInMultidimensionalArray($value=NULL, $items=array()){ | |
$getItems = []; | |
foreach ($items as $item_key => $itemDatas) { | |
if(is_array($itemDatas)){ | |
foreach ($itemDatas as $dsdf =>$itemData) { |
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 | |
/************************************************************************** | |
* ALL CUSTOM REST API ROUTES FOR 3rd PARTY USE | |
* @reference: https://developer.wordpress.org/rest-api/ | |
* @since 1.0 | |
* @author Razon | |
/**************************************************************************/ | |
// ALL CUSTOM REST ROUTE'S | |
add_action( 'rest_api_init', function () { |
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
// RESET FORM FIELDS BY RAZON | |
function resetFormFieldsValue(formFields){ | |
for(var count = 0; count < formFields.length; count++) { | |
formFields[count].value = ''; | |
} | |
} | |
var formFields = document.querySelectorAll('.checkout input, .checkout select'); // all input & select fields. | |
resetFormFieldsValue(formFields); |
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 | |
// Convert a English Number to Bengali (Bangla) Number | |
// REF: https://gist.github.com/nasirkhan/9778412 | |
function en2bnNumber ($number){ | |
$search_array= array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); | |
$replace_array= array("১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯", "০"); | |
$en_number = str_replace($search_array, $replace_array, $number); | |
return $en_number; | |
} |
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 | |
/* | |
* Ref 1: https://developer.wordpress.org/plugins/http-api/ | |
* Ref 2: https://developer.wordpress.org/reference/functions/wp_remote_request/ | |
* Dummy API Credit: https://jsonplaceholder.typicode.com/ | |
*/ | |
// Get a resource | |
$args = array( | |
'method' => 'GET', |