In your command-line run the following commands:
brew doctorbrew update
| <?php | |
| require __DIR__.'/vendor/autoload.php'; // <--- Notice this line, it's missing in example file | |
| // include __DIR__.'/build/GettyImagesApi.phar'; // <--- Uncaught DI\Definition\Exception\DefinitionException: Entry "ICurler" cannot be resolved | |
| include __DIR__.'/src/GettyImages_Client.php'; | |
| use GettyImages\Api\GettyImages_Client; | |
| $apiKey = "superSecretApiKey"; | |
| $apiSecret = "superSecretApiSecret"; |
In your command-line run the following commands:
brew doctorbrew update| @mixin prefix-border-radius($radius) { | |
| -webkit-border-radius: $radius; | |
| -moz-border-radius: $radius; | |
| -ms-border-radius: $radius; | |
| border-radius: $radius; | |
| } | |
| // http://joshbroton.com/quick-fix-sass-mixins-for-css-keyframe-animations/ | |
| @mixin animation($animate...) { | |
| $max: length($animate); |
I 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.16 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| var gulp = require('gulp'); | |
| var exec = require('child_process').exec; | |
| var cmakeCommand = "mkdir -p build; cd build; cmake ..;"; | |
| var cleanCommand = "rm -rf build"; | |
| var testCommand = "cd build; ctest -V"; | |
| //"cmake --build ." |
This is a list of the most helpful keyboard commands I use within top.
h shows help on interactive commands. Also see the top manual page
q to quit the program.
| <?php // /app/Http/Middleware/Cors.php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| class Cors { | |
| public function handle($request, Closure $next) | |
| { | |
| return $next($request) |
| 'use strict'; | |
| const statusCodes = require('http').STATUS_CODES; | |
| function createError(code, name) { | |
| return function(message) { | |
| Error.captureStackTrace(this, this.constructor); | |
| this.name = name; | |
| this.message = message; | |
| this.statusCode = code; | |
| } |
| { | |
| // Sample configuration for app in /home/myuser/app dir | |
| "uid": "app", | |
| "max": 5, // restart the app successively maximum of 5 times | |
| "spinSleepTime": 1000, // time to wait until a next restart is attempted (in ms) | |
| "append": true, // append the logs, do not overwrite | |
| "watch": true, // watch for changes and restart if they occur | |
| "script": "server.js", // main startup script (almost like issuing node server.js) | |
| "sourceDir": "/home/myuser/app", // the dir where your entire app code resides (dir structure is recursively traversed) | |
| "args": ["--myAPIKey", "xBlzdn84fa"] // pass any arguments to your app |
| <?php | |
| namespace App\Authentication; | |
| use Auth; | |
| use App\Authentication\UserProvider; | |
| use Illuminate\Support\ServiceProvider; | |
| class AuthServiceProvider extends ServiceProvider | |
| { |