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
<?php
namespace App\Mixins;
use Illuminate\Support\Facades\Response;
use stdClass;
class ResponseMixin
{
public function errors(): \Closure
@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:

<?php
namespace App\Traits;
use App\Exports\ExcelExport;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Facades\Excel;
trait Exportable
String.prototype.replaceTemplateVars = function (data){
let str = this;
// data is object
for (let key in data) {
str = str.replace(new RegExp(`{${key}}`, 'g'), data[key]);
}
return str;
}
document.addEventListener("DOMContentLoaded", function() {
// Global Variables
<style>
.page{
width:200px;
height:300px;
background:#eee;
padding:10px;
display: inline-block;
}
</style>
<div class="page">
@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
google.com, pub-5651806558038479, DIRECT, f08c47fec0942fa0
@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>
@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 / 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)