##Get Docker on Mac OSX:
###Step 1.
[https://docs.docker.com/installation/mac/][1]
install docker toolbox.
skip the docker quick start step and go to the "from your shell” section
##Get Docker on Mac OSX:
###Step 1.
[https://docs.docker.com/installation/mac/][1]
install docker toolbox.
skip the docker quick start step and go to the "from your shell” section
###Step 1 make sure xdebug is installed and as a zend extension.
sudo apt-get install php5-dev && sudo apt-get install php-pear
sudo pecl install xdebug
sudo apachectl restart
make sure xdebug has an .ini file check if there is one for your whole system or multiple. ( force php and apache to use the same conf.d xdebug.ini file)
drun() {
if [[ $# -eq 0 ]]
then
echo "Which container? Provide 1 argument."
return 0
fi
case "$1" in
'web' )
DNS_PROBE_FINISHED_BAD_CONFIG chrome fix on mac
Go to
system preferences > network
then select the connection type on the left. Click advanced on bottom right for that connection.
Proceed to the dns tab. from there I replaced the current server : 192.168.1.1
with googles dns server ipv4 : 8.8.4.4
| #Add vim to command line | |
| set -o vi | |
| # Random | |
| alias ll='ls -la' | |
| alias apache='sudo apachectl restart' | |
| alias hosts='sudo vi /etc/hosts' | |
| alias mysqlstart='sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist' | |
| alias mysqlstop='sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist' | |
| alias eip='curl icanhazip.com' | |
| alias iip='ifconfig | grep 192' |
| #/bin/bash | |
| #-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
| REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
| if [ -z "$REPO_URL" ]; then | |
| echo "-- ERROR: Could not identify Repo url." | |
| echo " It is possible this repo is already using SSH instead of HTTPS." | |
| exit | |
| fi |
The setup I am using, is I have a Node.js, express server that is listening on port 1337 using the host 127.0.0.1.
I then have Webpack dev server running on port 3000 and it proxies all traffic from 3000 to 1337, the server. Webpack dev server runs as a default on host 127.0.0.1 and for security reasons, other computers internally cannot access any server from that host.
As a fix, I had to change the (default) host to 0.0.0.0 in order to then access the internal ip and port (http://192.168.100.54:3000).
References:
| #!/bin/bash | |
| delete_nm() { | |
| find $1 -type d -maxdepth 1 -mtime +60 | xargs -I $ find $ -type d -name node_modules -maxdepth 1 -exec echo rm -rf {} \; | |
| read -p "Are you sure you wish to delete the node_modules folders above? " -n 1 -r | |
| echo # (optional) move to a new line | |
| if [[ $REPLY =~ ^[Yy]$ ]] | |
| then | |
| find ~/Projects -type d -maxdepth 1 -mtime +60 | xargs -I $ find $ -type d -name node_modules -maxdepth 1 -exec rm -rf {} \; | |
| echo "Finished delete" | |
| fi |
| // Separate the container and presentional components | |
| import React, { Component } from 'react' | |
| // Presentational component is pure. It is only responsible for accepting props and returning JSX. | |
| const Child = ({ show, onClickShow, onClickHide }) => ( | |
| <div> | |
| {show && <span>Now you can see me!</span>} | |
| <button onClick={onClickShow}>Show</button> | |
| <button onClick={onClickHide}>Hide</button> |
| // Definition - withPropertyHandlers.js | |
| import { compose, withHandlers } from 'recompose' | |
| function upperCaseFirstCharacter(str) { | |
| return `${str.charAt(0).toUpperCase()}${str.slice(1)}` | |
| } | |
| export default function withPropertyHandlers( | |
| properties, | |
| updaterName, | |
| updater, |