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 | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Exception\GuzzleException; | |
function uploadImage($requestUrl, $imageFilePath) | |
{ | |
$data = []; | |
try { |
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
/** | |
* Generates random string | |
* @param length | |
* @returns {string} | |
*/ | |
function generateRandomString(length) { | |
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
length = typeof length == 'undefined' ? 16 : length; | |
var rndCharIndex, rndStr = ""; |
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 Tests\Unit; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\DatabaseMigrations; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
use App\Models\Notification\PushNotification; | |
use App\Modules\Partner\Requests\CreatePushNotificationRequest; |
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 | |
/** | |
* Checks if string contains a domain name | |
* @param $string | |
* @return false|int | |
*/ | |
function checkIfContainsDomainName($string) | |
{ | |
$pattern = '/(http[s]?\:\/\/)?(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}/'; |
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 | |
public static function checkTextContainAnyArabicCharacters($text) | |
{ | |
return preg_match('/[^\x{0600}-\x{06FF}]/u', $text); | |
} | |
?> |
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 | |
/** | |
* Finds weeks by two dates | |
* @param $startDate | |
* @param $endDate | |
* @return array | |
*/ | |
public static function findWeeksBetweenTwoDates($startDate, $endDate) | |
{ |
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
git checkout dev -- public/images/nav-logo.png |
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 | |
/** | |
* Generates random string | |
* @param int $length | |
* @param string $charSet | |
* @return string | |
*/ | |
function generateRandomString($length = 10, $charSet = '') | |
{ |
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
### connect mysql with -s and -r parameter to print "DROP TABLE ..." lines without formated | |
mysql -u -s -r | |
### run the following sql query to generate "DROP TABLE ..." queries | |
SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') | |
FROM information_schema.tables | |
WHERE table_schema = '{DBNAME}'; | |
### disable foreign key check | |
SET FOREIGN_KEY_CHECKS = 0; |