Skip to content

Instantly share code, notes, and snippets.

@yvh
yvh / php-switch.sh
Last active March 12, 2018 08:41
PHP Switch
#!/usr/bin/env bash
# Author Yannick Vanhaeren
# Version 1.0.0
# Functions
############
function usage
{
echo "usage: php-switch [-a] | [-c] | [-h] | [-r] phpversion"
@yvh
yvh / start_mamp.sh
Last active April 8, 2016 10:07
Start homebrew mamp + Mailcatcher
#!/bin/bash
echo "Starting apache2"
sudo httpd -k start
mysql.server start
sudo mailcatcher --http-port 10000 --smtp-port 25
@yvh
yvh / set_proxy.sh
Created August 11, 2014 10:42
Set proxy in command line for ubuntu/gnome
#!/bin/bash
# Author Yannick Vanhaeren
# Version 0.1
# Functions
############
function usage
{
echo "usage: set_proxy [-p] | [-s] | [-h] mode"
@yvh
yvh / create-vhost.sh
Last active February 27, 2018 10:21
Shell command for create basic vhost for apache 2.4.*
#!/usr/bin/env bash
# Author Yannick Vanhaeren
# Version 1.0.0
# Functions
############
function usage
{
echo "usage: create-vhost [-a email] [-p port] [-e env] [-h] -v vhost_name -d document_root"
@yvh
yvh / mysql-backup.sh
Last active May 15, 2017 15:33
MySQL dump script
#!/usr/bin/env bash
# Author Yannick Vanhaeren
# Version 1.0
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
function usage
This file has been truncated, but you can view the full file.
diff --git a/Makefile.global b/Makefile.global
index 3a5b1c2..7450162 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -13,6 +13,8 @@ all: $(all_targets)
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
+build-binaries: $(PHP_BINARIES)
+
@yvh
yvh / composer-installer.sh
Last active May 3, 2018 07:58
Installer for composer by shell script
#!/usr/bin/env bash
# Author Yannick Vanhaeren
curl -Ss https://getcomposer.org/installer -o composer-setup.php
sha384sum -c <<< "`curl -Ss https://composer.github.io/installer.sig` composer-setup.php"
if [ $? -eq 0 ]; then
FILENAME="composer"
if [ -n "$1" ]; then
@yvh
yvh / composer-without-xdebug.sh
Last active October 19, 2016 17:16
Run composer without xdebug
#!/bin/bash
# Author Yannick Vanhaeren
# Version 1.0
COMPOSER_DISABLE_XDEBUG_WARN=1 \
`which php` -d xdebug.remote_enable=0 -d xdebug.profiler_enable=0 \
-d xdebug.default_enable=0 `which composer` "$@"
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
sudo wget --quiet -O /usr/local/bin/mailhog https://github.com/mailhog/MailHog/releases/download/v0.2.1/MailHog_linux_amd64
# Make it executable
sudo chmod +x /usr/local/bin/mailhog
@yvh
yvh / php-switch.sh
Created May 15, 2017 12:06
PHP Switch for homebrew
#!/usr/bin/env bash
# Initial creator: Phil Cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("53","54","55","56","70","71")
php_array=("php53" "php54" "php55" "php56" "php70" "php71")
php_installed_array=()
php_version="php$1"
php_opt_path="$brew_prefix\/opt\/"