most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeatI recently got a new Macbook Pro and wanted to document how I setup my PHP environment. I like full control of how PHP is built and I usually build it from source. I do this because I often add custom extensions and modules not found in the common PHP OSX installers. If your looking for a easier method than building from source try https://php-osx.liip.ch/.
NOTE: This post assumes you are running a fresh install of MacOS Sierra 10.12.2 with System Integrity Protection disabled. If you don't know how to disable it just boot into recovery mode and open a terminal and type
csrutil disable, or google search it :) This post also assumes you are using Zsh instead of Bash shell. If you are using Bash you can replace anytime you see~/.zshrcwith~/.bashrc.
First lets get some of the prerequisites. Start by grabbing the command line tools neccessary:
xcode-select --install| #!/bin/bash | |
| if [ ! -x /usr/bin/curl ]; then | |
| echo "Please install curl" | |
| exit 1 | |
| fi | |
| if [ ! -x /usr/bin/jq ]; then | |
| echo "Please install jq" | |
| exit 1 |
| import logging | |
| import os | |
| import time | |
| import traceback | |
| # pip install slackclient | |
| from slackclient import SlackClient | |
| --- | |
| # This has been tested with ansible 1.3 with these commands: | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
| # NB: The type of the variable is crucial! | |
| - name: Ansible Conditionals Examples | |
| hosts: $hosts | |
| vars_files: |
| <?php | |
| /* | |
| * World Cup Draw Example. | |
| * | |
| * Using Array functions & SPL Iterators to simulate (simplified) World Cup draws. | |
| * | |
| * @author Oscar Merida <oscar@phparch.com> | |
| * @author Edgar Sandi <edgar.r.sandi@gmail.com> (New FIFA rule added) | |
| */ |
| # Make sure the prerequisites are installed. | |
| sudo apt-get -y install autoconf automake curl build-essential libxslt1-dev re2c libxml2-dev bison | |
| # If don't have installed php use: | |
| sudo apt-get install php5 php5-dev php-pear php5-mysql php5-intl php5-mcrypt php5-sqlite php5-xdebug php5-xmlrpc php5-xsl php5-xcache php5-memcache libxslt1-dev | |
| # Install php archiver | |
| sudo pear install PHP_Archive-alpha | |
| # Install PHP 5 dependencies. |