Skip to content

Instantly share code, notes, and snippets.

View djoudi's full-sized avatar
🌍
Remotely Work

Abdelouahab Djoudi djoudi

🌍
Remotely Work
View GitHub Profile
@djoudi
djoudi / 404.php
Last active November 29, 2020 11:40
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="../css/font-awesome.min.css" >
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="../css/bootstrap.min.css" >
<p class="lead">
<h1>Contact Page</h1>
</p>
@djoudi
djoudi / mysql-backup.sh
Created October 9, 2020 13:47 — forked from daif/mysql-backup.sh
MySQL backup tool
#!/bin/bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@djoudi
djoudi / validate_saudi_id.sql
Created October 9, 2020 13:40 — forked from daif/validate_saudi_id.sql
Validate Saudi identity card number
#
# validate_saudi_id() function for MySQL/MariaDB
# This function will validate Saudi identity card number
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# by Daif Alazmi (http://daif.net)
@djoudi
djoudi / gist:0d4d4cc7e3423f4debe0bebea8186005
Created September 23, 2020 17:49 — forked from bonyiii/gist:822123
PostgreSQL BEFORE INSERT trigger with function
# Function returns user.login, current year, the primary_key which is the id, in 5 length (Example: 00045)
string format
# http://developer.postgresql.org/pgdocs/postgres/functions-formatting.html
# to_char(5,'00000') results the same number format
CREATE OR REPLACE FUNCTION "public"."function_name" () RETURNS trigger AS
'
BEGIN
NEW.title = (SELECT login FROM users WHERE id = NEW.author) || to_char(NOW(),\'YYYY\') || lpad(NEW.id::char, 5, \'0\');
RETURN NEW;
END
@djoudi
djoudi / README.md
Created August 13, 2020 15:33 — forked from mul14/README.md
Simple Laravel Search Trait

Usage

Put SearchTrait.php in app directory. Then use SearchTrait in your model, like so

use App\SearchTrait;
use Illuminate\Database\Eloquent\Model;

class Article extends Model 
{
@djoudi
djoudi / regex-arabic.md
Created July 31, 2020 14:11 — forked from Humoud/regex-arabic.md
Detecting arabic characters with regex.

Detect all Arabic Characters:

/[\u0600-\u06ff]|[\u0750-\u077f]|[\ufb50-\ufbc1]|[\ufbd3-\ufd3f]|[\ufd50-\ufd8f]|[\ufd92-\ufdc7]|[\ufe70-\ufefc]|[\uFDF0-\uFDFD]/

Summary:

  Arabic (0600—06FF, 225 characters)

  Arabic Supplement (0750—077F, 48 characters)
@djoudi
djoudi / serila numbers vmwar 15 pro
Created May 30, 2020 22:01 — forked from Solo-24/serila numbers vmwar 15 pro
Vmwar Workstation 15 Pro Serila Keys
Serial Keys:
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD
GV7N2-DQZ00-4897Y-27ZNX-NV0TD
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0
GZ3N0-6CX0L-H80UP-FPM59-NKAD4
YY31H-6EYEJ-480VZ-VXXZC-QF2E0
ZG51K-25FE1-H81ZP-95XGT-WV2C0
VG30H-2AX11-H88FQ-CQXGZ-M6AY4
@djoudi
djoudi / 000-HAproxy-Varnish-Apache-Wordpress-Letsencrypt
Created April 27, 2020 14:16 — forked from sys0dm1n/000-HAproxy-Varnish-Apache-Wordpress-Letsencrypt
HAproxy, Varnish and Apahce configuration files compatible for Wordpress with Apache webserver with Let's Encrypt
Configuration files to setup Wordpress with Apache2 webserver, Varnish caching server and HAproxy for loadbalancing with support for Lets Encrypt
@djoudi
djoudi / Kernel.php
Created March 22, 2020 07:56 — forked from ciamarro/Kernel.php
Maintain localization / locale when using Laravel Livewire
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
//----