Skip to content

Instantly share code, notes, and snippets.

View WatheqAlshowaiter's full-sized avatar

Watheq Alshowaiter WatheqAlshowaiter

View GitHub Profile
@muath-ye
muath-ye / BragDoc.md
Last active June 1, 2023 09:20
@WatheqAlshowaiter template for brag document

Brag document / weekly professional journal

Note: I advice you to write every thursday (at the end of the workday week)

week 23 (4 June, 2023)

Courses

<?php
function memoize($target) {
static $memo = new WeakMap;
return new class ($target, $memo) {
function __construct(
protected $target,
protected &$memo,
) {}
@ammardev
ammardev / deployment.yml
Last active January 14, 2023 21:30
مثال بسيط Github Actions + Laravel Envoy
name: Deployment
run-name: Deployment
on:
push:
branches:
- 'master' # انا مهتم بالرفع فقط عند دمج أي شيء على الفرع الرئيسي
jobs:
stage:
runs-on: ubuntu-latest
#!/usr/bin/python
# -*- coding=utf-8 -*-
"""
An example of cleaning arabic text with PyArbic Library
Requirements: pip install pyarabic
Data: text file
Ouput: text file ( cleaned)
"""
import sys
@xiCO2k
xiCO2k / view.blade.php
Created October 13, 2022 17:11
Infinite Image fadeIn fadeOut
<div
class="relative pointer-events-none"
x-data="{ active: 0 }"
x-init="setInterval(() =>
active = ++active > $el.childElementCount - 1 ? 0 : active
, 3000)"
>
@foreach([
'hero-pic1.webp',
'hero-pic2.webp',
@m-alghobary
m-alghobary / AppServiceProvider.php
Created August 29, 2022 05:46
A Laravel macro that adds a 'sync' method to the 'HasMany' relationship similar to the one on the 'BelongsTo' relationship.
<?php
namespace App\Providers;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\HasMany;
class AppServiceProvider extends ServiceProvider
@imAbdelhadi
imAbdelhadi / Linkedin learning subtitle translation to Arabic.js
Last active November 8, 2022 19:35
LinkedIn Learning ترجمة دورات لينكدإن ليرننج إلى اللغة العربية آليا
// طريقة التشغيل من موقعي على الرابط التالي: blog.abdelhadi.org
// ==UserScript==
// @name LinkedIn Learning ترجمة لينكدإن ليرننج
// @description LinkedIn Learning ترجمة دورات لينكدإن ليرننج إلى اللغة العربية
// @namespace https://github.com/journey-ad
// @version 0.2.1
// @icon https://static.licdn.cn/sc/h/2c0s1jfqrqv9hg4v0a7zm89oa
// @author journey-ad
// @match *://www.linkedin.com/learning/*
// @require https://greasyfork.org/scripts/411512-gm-createmenu/code/GM_createMenu.js?version=864854
@valorin
valorin / Middleware-CSP.php
Last active May 2, 2024 19:29
CSP Middleware - the simple CSP middleware I use across all of my projects.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\Str;
/**
* Simple Content Security Policy middleware.
@PovilasKorop
PovilasKorop / index.php
Created February 14, 2022 06:24
PHP NumberFormatter Demo
<?php
function getFormattedNumber(
$value,
$locale = 'en_US',
$style = NumberFormatter::DECIMAL,
$precision = 2,
$groupingUsed = true,
$currencyCode = 'USD',
) {
@Waseem-Almoliky
Waseem-Almoliky / Yemeni phone number regex.md
Last active July 30, 2023 19:26
yemeni phone numbers regex

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

yemeni phone number regex

Hello

this is a regex code to validate yemeni phone number for private companies and ground lines almost everything :) hope you found it useful.

/^(((\+|00)9677|0?7)[01378]\d{7}|((\+|00)967|0)[1-7]\d{6})$/