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 | |
/** | |
* Created by PhpStorm. | |
* User: Dev_Hassan | |
* Date: 12/4/17 | |
* Time: 8:37 PM | |
*/ | |
class SaudiMobileNumber | |
{ |
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 | |
/** | |
* Created by PhpStorm. | |
* User: dhassanali | |
* Date: 12/4/17 | |
* Time: 8:56 PM | |
*/ | |
class Digit | |
{ |
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 cleanEmoji($str) { | |
$clean_text = ""; | |
// Match Emoticons | |
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u'; | |
$clean_text = preg_replace($regexEmoticons, '', $str); | |
// Match Miscellaneous Symbols and Pictographs | |
$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u'; |
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
CREATE TABLE `cars` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(32) NOT NULL, | |
`brand_id` int(11) NOT NULL DEFAULT 0, | |
PRIMARY KEY (`id`) | |
) ENGINE = InnoDB DEFAULT CHARSET = utf8; | |
INSERT INTO `cars` (`id`, `name`, `brand_id`) | |
VALUES | |
(1, 'تويوتا', 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
function binarySearch(elm, set) { | |
let i = 0 | |
let j = set.length - 1 | |
while (i < j) { | |
const m = Math.floor((j + i) / 2); | |
if (elm > set[m]) | |
i = m + 1 | |
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
<?php | |
namespace App\Library\Database\Query; | |
use Illuminate\Database\Query\Builder as QueryBuilder; | |
class Builder extends QueryBuilder | |
{ | |
/** | |
* Insert a new record into the database. |
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
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () { | |
try { | |
return Boolean(new Blob()); | |
} catch (e) { | |
return false; | |
} | |
}()); | |
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () { | |
try { |