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 / .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]
@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 / auto replace SRC,HREF with Laravel functions.md
Last active July 5, 2024 14:37
[laravel asset function] how to auto replace SRC,HREF with Laravel function using regex

This is the best I have so far using regex:

Find:

<((?!\s*((a)\s+))\w+)(.*?)((?:src|href)\s*=\s*")((?!\{\{\s*)[^"]+)"

Replace with:

&lt;$1$4$5{{ asset('$6') }}"
$('form').submit(function (event) {
event.preventDefault();
var _this = $(this);
$.ajax({
type: "POST",
url: _this.attr('action'),
data: new FormData(this),
processData: false,
contentType: false,
success: function (data) {
@egyjs
egyjs / variousCountryListFormats.js
Created July 15, 2020 19:14 — forked from incredimike/variousCountryListFormats.js
Country list as javascript array (alphabetical)
// Lists of countries with ISO 3166 codes, presented in various formats.
// Last Updated: Nov 15, 2019
// If you're using PHP, I suggest checking out:
// https://github.com/thephpleague/iso3166
//
// JS developers can check out:
// https://www.npmjs.com/package/iso3166-2-db
// List of all countries in a simple list / array.
@egyjs
egyjs / get.py
Last active February 21, 2021 00:40
get ts, m3u8 files video and convert it to mp4
import os
folderName = 'folderName'
fileurl = "fileurl"
m3u8file = folderName+"/m3u8/480p.m3u8"
if not os.path.exists(folderName):
os.makedirs(folderName)
@egyjs
egyjs / readme.md
Last active June 20, 2021 14:56
new kinux os install setup

init

sudo apt update -y && sudo apt upgrade -y
sudo apt install php-xml php-mysql php-curl php-mbstring  -y
sudo apt install composer -y
sudo install snap && sudo snap

// if snap is installed successfully

@egyjs
egyjs / test.xml
Created August 31, 2021 15:10
twiml
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>$content</Say>
<Play>https://vttts.readspeaker.com/cgi-bin/nph-voicetext/17c6a09ed76c9306e9cedcc9c645cce9.mp3</Play>
</Response>
google.com, pub-5651806558038479, DIRECT, f08c47fec0942fa0
@egyjs
egyjs / git-bisect.md
Created January 13, 2023 15:42
Useful tips

One useful Git tip is to use the command "git stash", to find the commit that introduced a bug in your code. This command allows you to perform a binary search through your commits to quickly locate the commit that caused the bug.

For example, let's say you have a bug in your code and you know it was not present in a previous version. You can use the command "git bisect" to start the search process:

$ git bisect start