Skip to content

Instantly share code, notes, and snippets.

View zaherg's full-sized avatar
🎯
Focusing

Zaher Ghaibeh zaherg

🎯
Focusing
View GitHub Profile
@zaherg
zaherg / info.plist
Last active September 2, 2017 06:22
electron open file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>16E195</string>
<key>CFBundleDisplayName</key>
<string>Electron</string>
<key>CFBundleExecutable</key>
<string>Electron</string>
@zaherg
zaherg / README.md
Created November 17, 2017 19:22 — forked from ralphschindler/README.md
Docker For Mac Host Address Alias To Enable PHP XDebug (10.254.254.254 Trick)

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254.

Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host.

Installation Of IP Alias (This survives reboot)

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

@zaherg
zaherg / bitbucket-pipelines.yml
Last active March 6, 2018 20:18
bitbucket-pipelines.yml
clone: # the 'clone' section
depth: 1 # the depth, in this case the clone will contain last commit
options:
max-time: 10
docker: true
image: zaherg/php-7.1-xdebug-alpine:latest
pipelines:
caches:
- composer
@zaherg
zaherg / install_pdftk.sh
Created May 19, 2018 22:43 — forked from rmehner/install_pdftk.sh
Install PDFTk without touching up the permissions
#!/usr/bin/env bash
# This is based on this excellent gist https://gist.github.com/jvenator/9672772a631c117da151
# Nothing of this is my original work, except that I made the download link an argument
# to this script, so it installs on OSX 10.11
#
# Thank you jvenator & sethetter
set -e
error() { info "$1"; exit 1; }
@zaherg
zaherg / netlify.toml
Created July 28, 2018 05:59
Adding netlify.toml to your code before pushing to netlify.com
[build]
command = "npm run production"
publish = "build_production"
[build.environment]
PHP_VERSION="7.2"
@zaherg
zaherg / lwp-cloudflare-dyndns.sh
Created December 25, 2018 14:00 — forked from Firsh/lwp-cloudflare-dyndns.sh
CloudFlare as Dynamic DNS
#!/bin/bash
# CloudFlare as Dynamic DNS
# From: https://letswp.io/cloudflare-as-dynamic-dns-raspberry-pi/
# Based on: https://gist.github.com/benkulbertis/fff10759c2391b6618dd/
# Original non-RPi article: https://phillymesh.net/2016/02/23/setting-up-dynamic-dns-for-your-registered-domain-through-cloudflare/
# Update these with real values
auth_email="[email protected]"
auth_key="global_api_key_goes_here"
zone_name="example.com"
@zaherg
zaherg / ufw.sh
Last active February 17, 2019 11:32
ufw
#!/bin/sh
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow https
ufw allow http
ufw allow 2376/tcp
ufw allow 2377/tcp
ufw allow 4789/udp
<?php
namespace App\Factories;
abstract class Factory
{
public function instance()
{
return $this;
}
@zaherg
zaherg / Readme.MD
Created April 29, 2019 13:54 — forked from JacobBennett/Readme.MD
Regarding Filesystems