Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
WIP

Irfaq Syed irazasyed

🎯
WIP
View GitHub Profile
@irazasyed
irazasyed / global-cli-tools.md
Created May 20, 2023 21:15
Global NPM CLI Tools & Brew Packages
View global-cli-tools.md

Must Have Global CLI Tools & Brew packages on macOS

NPM

alex
cash-cli
fkill-cli
tldr
tree-cli
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active May 18, 2023 22:49
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide
View outbound-email-with-cloudflare.md

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@irazasyed
irazasyed / ArrayToShapeConverter.php
Last active May 17, 2023 18:30
PHP: Array to ArrayShape Converter for PHPDocs
View ArrayToShapeConverter.php
<?php
namespace App\Services;
use ReflectionClass;
use Illuminate\Support\Facades\File;
class ArrayToShapeConverter
{
public function __construct(private string $basePath, private readonly string $namespace)
@irazasyed
irazasyed / README.md
Last active May 22, 2023 06:37
Instructions on How to use Cloudflare Argo Tunnel to Share Laravel Valet Site on macOS and Helper Bash Script
View README.md

How to use Cloudflare Argo Tunnel to Share Laravel Valet Site on macOS

Set up a tunnel locally

1. Download and install cloudflared

brew install cloudflare/cloudflare/cloudflared
@irazasyed
irazasyed / install.sh
Created February 26, 2023 00:31
WordOps LEMP Stack Installation and Configuration
View install.sh
wget -qO wo wops.cc && sudo bash wo
# Auto completion
source /etc/bash_completion.d/wo_auto.rc
echo -e "alias wo='sudo -E wo'" >> $HOME/.bashrc
source $HOME/.bashrc
# Install stack
wo stack install
@irazasyed
irazasyed / composer-process-issue-solution.md
Created April 18, 2022 01:24
Composer - The process has been signaled with signal "6" - Solution
View composer-process-issue-solution.md

Composer - The process has been signaled with signal "6" - Solution

If you're on macOS and suddenly composer has started throwing this weird error and you're wondering where the problem is, well, here's the solution and how to debug.

Problem

Error when you run composer global update or any other similar commands.

In Process.php line 441:
@irazasyed
irazasyed / ip-address.php
Created March 5, 2022 01:02
PHP: Retrieve the IP address of the visitor.
View ip-address.php
<?php
/**
* Retrieve the IP address of the visitor.
*
* @return string
*/
function getIPAddress()
{
foreach (['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'] as $key) {
@irazasyed
irazasyed / Kernel.php
Created January 6, 2022 21:38 — forked from mkwsra/Kernel.php
Laravel middleware to store marketing related query string params
View Kernel.php
// Usage
class Kernel extends HttpKernel
{
// .....
// .....
// .....
protected $routeMiddleware = [
// .....
@irazasyed
irazasyed / mysq-mariadb-macos-start-issue.md
Created October 7, 2020 00:05
Solution for MySQL / MariaDB Start Issue on MacOS
View mysq-mariadb-macos-start-issue.md

Solution for MySQL / MariaDB Start Issue on MacOS

Errors

On trying to start mysql.server start

./usr/local/bin/mysql.server: line 264: kill: (12262) - No such process ERROR!

@irazasyed
irazasyed / google-fonts-async.html
Created May 28, 2020 19:30
Google Fonts Async Snippet
View google-fonts-async.html
<!--
- Info: https://csswizardry.com/2020/05/the-fastest-google-fonts/
-
- 1. Preemptively warm up the fonts’ origin.
-
- 2. Initiate a high-priority, asynchronous fetch for the CSS file. Works in
- most modern browsers.
-
- 3. Initiate a low-priority, asynchronous fetch that gets applied to the page
- only after it’s arrived. Works in all browsers with JavaScript enabled.