Skip to content

Instantly share code, notes, and snippets.

View mshannaq's full-sized avatar

Mohammed AlShannaq mshannaq

View GitHub Profile
@mshannaq
mshannaq / install_cloudpanel_on_debian11_programmatically.sh
Last active November 23, 2023 22:34
Install CloudPanel programmatically on Debian 11
#!/bin/bash
# CloudPanel Installation Script
# use this as an initialization script after creating a VM to install CloudPanel into
# your VM instance.
# you can use it in Digitalocean Initialization scripts or AWS user data.
# tested on DigitalOcean Droplets with Debian 11 on 24 Nov 2023
#
# @author: @mshannaq , Extendy team
# @License: MIT
@mshannaq
mshannaq / .php-cs-fixer.php
Created December 10, 2023 03:32
.php-cs-fixer.php for laravel 10.x that I use
<?php
/* .php-cs-fixer.php for laravel 10.x */
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@mshannaq
mshannaq / macos_keyboard_hack_homebtn
Last active December 18, 2023 14:24
define 'Home' and 'End' on MacOS (uses Microsoft Keyboard) to be like Microsoft Windows
As you know in Microsoft Windows there is a button 'Home' which go to the begning of line and and button 'End' goes to the end of line.
In MacOS if you use Keyboard others that Mac Keyboard you cannot use 'Home' and 'End' button because it is not defined.
buu sure you can customize it and use it exactly as you use on Microsoft Keyboard
to do that open terminal and goto folder `~/Library/KeyBindings/` by running the command
```bash
cd ~/Library/KeyBindings/
@mshannaq
mshannaq / index.html
Created December 22, 2023 23:21 — forked from redgeoff/index.html
Image Paste Textarea
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Paste Image Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.6/bluebird.min.js"></script>
</head>
<body>
@mshannaq
mshannaq / wordpressapi.php
Created February 24, 2024 00:38
wordpress api new post example
مثال علي استخدام
wordpress api
لانشاء مقال جديد
مثال
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Basic YWRtaW46eW91ci1hcHBsaWNhdGlvbi1wYXNzd29yZA==" \
-d '{
@mshannaq
mshannaq / gist:9d17d5a94997318d967739ebc46f5a44
Created February 27, 2024 21:30
create ssh key to access linux servers
how to create ssh key to access linux servers using key
@mshannaq
mshannaq / gist:bc38bb01b76e2fe037e92faf06c6239f
Created May 7, 2024 05:37 — forked from homaily/gist:8672499
Regex to validate saudi mobile numbers

السلام عليكم ، هذا كود ريجيكس بسيط للتحقق من صحة أرقام الجوالات السعودية ، يقوم الريجيكس بالتحقق من مفتاح الدولة ، مفتاح شركة الإتصالات لضمان صحة النص المدخل .

Hello, this is a simple regex to validate saudi mobile numbers, the code will validate country code, telecome company code and make sure the tested sting is correct .

/^(009665|9665|\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/

Regex Breakdown - شرح الكود