Skip to content

Instantly share code, notes, and snippets.

@IsmailShurrab
IsmailShurrab / 1_customFunctions.php
Created August 13, 2017 19:58 — forked from MrShennawy/1_customFunctions.php
now you can query by regexp in laravel !! بالعربى إزاى تعمل بحث بالألف همزه ومن غير وهكذا ة ه وال ي وي ..... إلخ
<?php
//الملف ده اللى بيكون موجود فيه الدوال المساعده للشغل وغالبا بيكون مساره كالتالى
// app/helper/help.php
// ملحوظه (الملف ده انت اللى بتعمله عشان تحط جوا الفنكشنز اللى هتساعدك فى شغلك )0
#================ search at sql text to regx =====================================
function sql_text_to_regx($string){
$alamat = array("+","=","-","_",")","(","*","&","^","%","$","#","@","!","/","\\","|",">","<","?","؟");
$alamat_change = "";
$alef = array("ا","أ","آ","إ");
$alef_change = "@@@";
@IsmailShurrab
IsmailShurrab / firebase notification curl
Created December 10, 2017 12:35
firebase notification curl php
<?php
$url = "https://fcm.googleapis.com/fcm/send";
$token = "your device token";
$serverKey = 'your server token of FCM project';
$title = "Notification title";
$body = "Hello I am from Your php server";
$notification = array('title' =>$title , 'text' => $body, 'sound' => 'default', 'badge' => '1');
$arrayToSend = array('to' => $token, 'notification' => $notification,'priority'=>'high');
$json = json_encode($arrayToSend);
$headers = array();
@IsmailShurrab
IsmailShurrab / compat_l5.php
Created December 16, 2017 09:20 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@IsmailShurrab
IsmailShurrab / installing-an-ssl-certificate-under-apache-xampp.md
Created December 17, 2017 15:41
Installing an SSL Certificate under Apache (XAMPP)
@IsmailShurrab
IsmailShurrab / SSLXampp.md
Created December 17, 2017 15:43 — forked from nguyenanhtu/SSLXampp.md
Guide to configure SSL in XAMPP for Windows

How to test 'https' in XAMPP for localhost ? I will guide you

Menu

  • Create certificate
  • Config Apache to access https instead of http
  • Config mod rewrite to generate SSL url
  • Config Virtual host to test site

Step 1 : Create certificate

  • Go to your XAMPP installation directory (in my case it’s E:\xampp), figure out apache folder. In this, find & run batch file
Here is the key code for each key stroke in JavaScript. You can use that and detect if the user has pressed the Shift key.
backspace 8
tab 9
enter 13
shift 16
ctrl 17
alt 18
pause/break 19
caps lock 20
@IsmailShurrab
IsmailShurrab / EmployeeRestaurant
Created January 6, 2018 14:58
EmployeeRestaurant
<?php
namespace App\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class EmployeeRestaurant extends Authenticatable
{
protected $casts = [
@IsmailShurrab
IsmailShurrab / Schedulable.php
Created March 10, 2018 09:22 — forked from davidpiesse/Schedulable.php
Laravel Custom Class/Model Scheduling
<?php
//Don't forget to change the namespace!
namespace App\Traits;
use Cron\CronExpression;
use Illuminate\Support\Carbon;
use Illuminate\Console\Scheduling\ManagesFrequencies;
trait Schedulable{
@IsmailShurrab
IsmailShurrab / Dockerfile
Created April 15, 2018 22:37 — forked from michaelneu/Dockerfile
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli
RUN echo "hostname=localhost.localdomain" > /etc/ssmtp/ssmtp.conf
RUN echo "root=root@example.com" >> /etc/ssmtp/ssmtp.conf
@IsmailShurrab
IsmailShurrab / WebSocketController.php
Created August 8, 2018 08:11 — forked from Mevrael/WebSocketController.php
Laravel + WebSocket (Ratchet/ReactPHP) integration
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cookie;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Session;
use Ratchet\WebSocket\Version\RFC6455\Connection;