Skip to content

Instantly share code, notes, and snippets.

View egyjs's full-sized avatar
:shipit:
the perfect man for the job

AbdulRahman El-zahaby egyjs

:shipit:
the perfect man for the job
View GitHub Profile
@egyjs
egyjs / remove duplicates item from object in array javascript.js
Last active June 1, 2020 12:19
remove duplicates item from object in array [v-for]
const arr = [
{ id: 1, name: "king" },
{ id: 2, name: "master" },
{ id: 3, name: "lisa" },
{ id: 4, name: "ion" },
{ id: 5, name: "jim" },
{ id: 6, name: "gowtham" },
{ id: 1, name: "jam" },
{ id: 1, name: "lol" },
{ id: 2, name: "kwick" },
@egyjs
egyjs / .htaccess
Last active June 5, 2020 05:48
Laravel 5-6 – Remove Public from URL
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
DB::table('data_location_country')->delete();
$data = array(
['slug' => 'AF', 'title' => 'Afghanistan', 'native' => 'غانستان'],
['slug' => 'AX', 'title' => 'Åland Islands', 'native' => 'Åland'],
['slug' => 'AL', 'title' => 'Albania', 'native' => 'Shqipëri'],
['slug' => 'DZ', 'title' => 'Algeria', 'native' => 'الجزائر'],
['slug' => 'AS', 'title' => 'American Samoa', 'native' => ''],
['slug' => 'AD', 'title' => 'Andorra', 'native' => ''],
['slug' => 'AO', 'title' => 'Angola', 'native' => ''],
['slug' => 'AI', 'title' => 'Anguilla', 'native' => ''],
@egyjs
egyjs / ElzahabyDynamicLaravelString.php
Last active November 14, 2019 03:47
make 'string syntax' to dynamic Laravel php
function ElzahabyDynamicLaravelString($model,$syntax,$sign=null){
if (isset($model) && $syntax == null){
$input = $model::getListFields()['syntax'];
}else {
$input = $syntax;
}
$output = $input;
$regex = '/'.(($sign != null)?$sign:':-:').'[a-z._]+/im';
if (preg_match_all($regex, $input, $matches, PREG_PATTERN_ORDER)) {
@egyjs
egyjs / dns.txt
Created August 4, 2019 18:36 — forked from PacodiazDG/dns.txt
dns
www
mail
ftp
localhost
webmail
smtp
pop
ns1
webdisk
ns2
@egyjs
egyjs / php-html-css-js-minifier.php
Created July 10, 2019 11:53 — forked from Rodrigo54/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@egyjs
egyjs / Lorem IpsumJS.md
Last active July 26, 2019 12:41
Lorem Ipsum - All the facts - Lipsum generator by javascript
@egyjs
egyjs / getImgFromString.php
Created June 11, 2018 03:42
PHP | get all <img> tag and extract the “src” attribute
<?php
function getImgFromString($html){
preg_match_all('/<img[^>]+>/i',$html, $result);
$img = array();
$i = 0;
foreach( $result[0] as $img_tag)
{
preg_match_all('/(src)="([^"]+)"/i',$img_tag, $img[$i]);
$i++;
@egyjs
egyjs / Direct Link of YouTube videos.md
Last active November 11, 2024 10:13
PHP API To get Direct Link of YouTube videos
@egyjs
egyjs / jekyll-and-liquid.md
Created February 10, 2018 14:26 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes: