Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
WIP

Irfaq Syed irazasyed

🎯
WIP
View GitHub Profile
@irazasyed
irazasyed / composer-process-issue-solution.md
Created Apr 18, 2022
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 Mar 5, 2022
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 Jan 6, 2022 — 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 Oct 7, 2020
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
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.
@irazasyed
irazasyed / howto-enable-dnscrypt-proxy-v2-netgear-router.md
Last active Feb 23, 2020
How to Enable DNSCrypt-Proxy v2 on Netgear X4S R7800 / R8900 / R9000 Router
View howto-enable-dnscrypt-proxy-v2-netgear-router.md

How to Enable DNSCrypt-Proxy v2 on Netgear X4S R7800 / R8900 / R9000 Router

Supported routers (Netgear R7800, R8900, and R9000)

Prerequisite

  • Make sure telnet is enabled in your router. You can visit this page and enable (login when prompted): http://www.routerlogin.com/debug.htm.
  • Once you telnet into your router using your routers password, you should setup your SSH key.
  • [Recommended] Add SSH key id_rsa.pub to /root/.ssh/authorized_keys (You might have to create this dir and file manually if not it doesn't already exist).
View regex-worker.js
// Perform regex replacements and inject CSS/JavaScript with Cloudflare Workers
// https://community.cloudflare.com/t/perform-regex-replacements-and-inject-css-javascript-with-cloudflare-workers/90279
addEventListener('fetch', event => {
event.passThroughOnException()
event.respondWith(handleRequest(event.request))
})
/**
* Fetch and log a given request object
* @param {Request} request
View .gitignore_global
*~
*.diff
*.err
*.orig
*.rej
*.swo
*.swp
*.vi
# Compiled source #
@irazasyed
irazasyed / 1-dnsmasq-dnscrypt-proxy-setup.md
Last active Aug 23, 2022
How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS
View 1-dnsmasq-dnscrypt-proxy-setup.md

How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

Using Laravel Valet for localhost development, So it installs dnsmasq with it. dnsmasq runs on port 53, The default DNS port. So we setup dnscrypt-proxy on port 5300 with the default config files in this gist.

dnscrypt-proxy Installation

brew install dnscrypt-proxy
View card-popup-effect.css
.card {
transition: 0.5s;
backface-visibility: hidden;
transform: translateZ(0);
}
.card:hover {
box-shadow: 0 30px 70px #000;
transform: scale3d(1.05, 1.05, 1.05);
}