Skip to content

Instantly share code, notes, and snippets.

@keriat
Forked from anilcancakir/macos.md
Created January 12, 2020 00:28
Show Gist options
  • Save keriat/637a161a305eaf3faf94434446fc21fe to your computer and use it in GitHub Desktop.
Save keriat/637a161a305eaf3faf94434446fc21fe to your computer and use it in GitHub Desktop.
Anilcan's macOS Setup - (PHP, PostgreSQL, Featured Apps...)

Anilcan's macOS Setup

This my personal development MacOS environment. It contains a type of software and custom improvements.

Softwares

Terminal

Searching (Spotlight alt)

Editor (Simple)

Editor

Database

PostgreSQL Tools

Browser

HTTP Request Client

Design Tool

Window Manager for Mac

Maintance & Tune

Advanced Settings

File Archiver

Screen Recorder

Advanced clipboard

Brew (Homebrew)

Package Manager

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Zsh is a shell designed for interactive use, although it is also a powerful scripting language.

brew install zsh
chsh -s /bin/zsh
# Testig the active SHELL
echo $SHELL

Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Disable Last login line

touch .hushlogin

A fast reimplementation of Powerlevel9k ZSH theme

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

Set ZSH_THEME=powerlevel10k/powerlevel10k in your ~/.zshrc.

Fish-like autosuggestions for zsh

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Add zsh-autosuggestions to plugins variable in your ~/.zshrc.

Fish shell like syntax highlighting for Zsh

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Add zsh-syntax-highlighting to plugins variable in your ~/.zshrc.

General-purpose scripting language

Add brew to plugins variable in your ~/.zshrc.

Then try to test brew status by running brew doctor command.

brew install php

A Dependency Manager for PHP

brew install composer

Add composer to plugins variable in your ~/.zshrc.

Platform built on V8 to build network applications

brew install node

I prefer install to LTS version (12.x)

brew install node@12
brew link --force --overwrite node@12

# Manual way
cd /usr/local/bin
ln -s ../Cellar/node@12/12.14.0/bin/node node
ln -s ../Cellar/node@12/12.14.0/bin/npm npm
ln -s ../Cellar/node@12/12.14.0/bin/npx npx

# Testing
node -v
npm -v

Fast, reliable, and secure dependency management.

brew install yarn

Add yarn to plugins variable in your ~/.zshrc.

nginx - Optional

HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server

brew install nginx

Edit plugins line in your .zshrc file

plugins=(git brew composer yarn sublime laravel5 sudo zsh-autosuggestions zsh-syntax-highlighting)

The PHP Framework for Web Artisans

composer global require laravel/installer

Persistent key-value database, with built-in net interface

brew install redis

If you gives error, you should correct extension_dir variable in your php.ini file or you should create directory which is like /usr/local/Cellar/php/7.4.1/pecl/20190902.

Warning

pecl may added a extension="redis.so" line to php.ini file. You should remoe this line.

Create a file which is /usr/local/etc/php/7.4/conf.d/ext-xdebug.ini

extension="redis.so"

PHP Redis extension

pecl install redis

PHP IMAP extension

brew tap kabel/php-ext
brew install php-imap

After imap installation, your php cli can be slow. You can solve this problem by this solution.

  1. You need your machine hostname then you need to copy that. For example, it return Anlcans-Air in my computer.
hostname
  1. You need to edit your /etc/hosts file and you need to paste your hostname with .local postfix for 127.0.0.1 and ::1 ip addresses. For example,
127.0.0.1 localhost Anlcans-MacBook-Air.local
::1 localhost Anlcans-MacBook-Air.local

PHP Xdebug extension

pecl install xdebug

Warning

pecl may added a zend_zend_extension="xdebug.so" line to php.ini file. You should remoe this line.

Create a file which is /usr/local/etc/php/7.4/conf.d/ext-xdebug.ini

[xdebug]
zend_extension="xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port="9000"
xdebug.idekey="PHPSTORM"

In PhpStorm Settings should be

Preferences | Languages & Frameworks | PHP | Debug

Xdebug
Debug Port: 9000
Can accept external connections: yes
Force break at first line when no path mapping specified: yes
Force break at first line when a scipt is outside the project: yes

Then, you should install Browser Debugging Extensions for your browser. For chrome, you can use Xdebug helper extension.

nginx virtual hosts

Coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment