Skip to content

Instantly share code, notes, and snippets.

View amrography's full-sized avatar
🚀
...

Amro Khaled amrography

🚀
...
View GitHub Profile
@amrography
amrography / archive.sh
Created September 3, 2018 10:51
Create archive of files changed between 2 gits commits
zip modified-files.zip $(git diff --name-only HASH1 HASH2)
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AsssignProductsForeignKeys extends Migration
{
/**
* Run the migrations.
@amrography
amrography / SelectCity.php
Created July 6, 2020 17:25
Livewire select drop menu example
<?php
// file path, app/Http/Livewire/SelectCity.php
namespace App\Http\Livewire;
use Livewire\Component;
class SelectCity extends Component
{
@amrography
amrography / _background-variant-transparent.scss
Last active September 26, 2020 10:01
Extend bootstrap 4 with transparent background from bootstrap theme colors
/**
* USAGE
*
* <div class="bg-light-65"></div>
* <div class="bg-primary-20"></div>
*
* <a href="#" class="btn btn-danger-50">Button too</a>
* ...
*/
@amrography
amrography / README.md
Last active March 5, 2021 12:47
Send email using PHPMailer and Gmail
@amrography
amrography / README.md
Last active April 29, 2021 19:50
Set cookie in postman pre-request for Laravel Nova #api

Postman pre-request snippet for Laravel Nova

Get XSRF token and set it to a cookie variable in postman for using later.

@amrography
amrography / mysql.sh
Last active April 29, 2021 20:25
[Change mysql password] Update mysql password using command line #mysql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
@amrography
amrography / git-deployment.md
Created November 18, 2021 09:43 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@amrography
amrography / array_to_xml.php
Created October 26, 2023 05:32
array_to_xml.php
<?php
use App\Services\AvroService;
require 'vendor/autoload.php';
$wrapper = <<<XML
<root />
XML;
$xml = new SimpleXMLElement($wrapper);