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 / Automating Postman to Swagger with Version Control in Laravel Vapor.md
Last active January 18, 2024 16:17
Automating Postman to Swagger with Version Control using GitHub Actions and Laravel

Title: Automating Postman to Swagger with Version Control in Laravel Vapor


Hey folks! 👋 I wanted to share a neat workflow I've implemented for our Laravel Vapor project that automates the generation and upload of Swagger documentation with each Git tag, all seamlessly integrated with Postman. 🚀

🤖 GitHub Actions Workflow (deploy.yml)

With every push to a dev/* tag, GitHub Actions springs into action:

@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') }}"
@fworks
fworks / install-zsh-windows-git-bash.md
Last active October 16, 2024 06:29
Zsh / Oh-my-zsh on Windows Git Bash
@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 / 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 September 1, 2024 08:24
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:

@PacodiazDG
PacodiazDG / dns.txt
Created November 11, 2017 19:50
dns
www
mail
ftp
localhost
webmail
smtp
pop
ns1
webdisk
ns2