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 / 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; }
caches:
- composer
@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:
@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 / 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 / btc-eth-dca-buy.php
Created August 24, 2017 11:26 — forked from levelsio/btc-eth-dca-buy.php
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
@zaherg
zaherg / vagrant-ssh-node
Created August 21, 2017 13:37 — forked from neilk/vagrant-ssh-node
SSH into a Vagrant VM, such that Node.js can be debugged from a debugger or IDE in the host operating system. For some reason, port forwarding in the Vagrant file does not work. See https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q
#!/bin/bash
# SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger
# or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work.
# (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q)
/usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config
ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default
rm $TMPDIR/vagrant-ssh-config
@zaherg
zaherg / errr.txt
Created July 18, 2017 08:55
Errors
[ok]: Connect multiple slaves at the same time (issue #141), diskless=yes
[21/46 done]: integration/replication (132 seconds)
Testing integration/replication-2
[ok]: First server should have role slave after SLAVEOF
Logged warnings (pid 8112):
(none)
Logged warnings (pid 8097):
@zaherg
zaherg / .env.gitlab
Created July 17, 2017 12:11
Laravel Dusk (PHPUNIT) Test for Gitlab-ci with docker chromdriver , headless chrome, vnc, screenshots, pipeline, artifacts
APP_ENV=testing
APP_KEY=base64:DimZ0aVNA8ZWtWxTB4fDxFc6lL1wM2C7evETA4QK3+c=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:8081
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=secca_testing
@zaherg
zaherg / Dockerfile
Created June 12, 2017 09:01
alpine with node
FROM alpine:3.5
# install node
RUN apk add --no-cache nodejs-current tini
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Build time argument to set NODE_ENV ('production'' by default)
ARG NODE_ENV