This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
# first install pygmentize to the mac OS X or macOS system with the built-in python | |
sudo easy_install Pygments | |
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc. | |
alias pcat='pygmentize -f terminal256 -O style=native -g' |
How to configure Bash Completion on Mac for Docker and Docker-Compose
Run:
brew install bash-completion
Run:
curl -L "https://raw.githubusercontent.com/docker/compose/$(docker-compose version --short)/contrib/completion/bash/docker-compose" > /usr/local/etc/bash_completion.d/docker-compose
After Sierra upgrade, all my JDK were removed. So here is how I reinstalled all of them with only brew commands, and manage them with jEnv.
First do all your mac updates (especially XCode), then:
Install Brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# check if `docker-machine` command exists | |
if command -v docker-machine > /dev/null; then | |
# fetch the first running machine name | |
local machine=$(docker-machine ls | grep "Running" | head -n 1 | awk '{ print $1 }') | |
if [ "$machine" != "" ]; then | |
eval "$(docker-machine env $machine)" | |
fi | |
fi |
Delete all containers
$ docker ps -q -a | xargs docker rm
-q prints only the container IDs -a prints all containers
Notice that it uses xargs to issue a remove container command for each container ID
function makePropertyMapper<T>(prototype: any, key: string, mapper: (value: any) => T) { | |
const values = new Map<any, T>(); | |
Object.defineProperty(prototype, key, { | |
set(firstValue: any) { | |
Object.defineProperty(this, key, { | |
get() { | |
return values.get(this); | |
}, | |
set(value: any) { | |
values.set(this, mapper(value)); |
Install cask
that extends the brew
command :
brew install phinze/cask/brew-cask
Install calibre
using cask
:
brew cask install calibre
upstream websocket { | |
server localhost:3000; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
access_log /var/log/nginx/websocket.access.log main; |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |