Let's say you want to host domains first.com and second.com.
Create folders for their files:
| // quick snippet to check the connection in your RN app | |
| // dispatches an `setIsConnected` action every time the NetInfo changes (on/off network) | |
| componentDidMount() { | |
| const dispatchConnected = isConnected => this.props.dispatch(setIsConnected(isConnected)); | |
| NetInfo.isConnected.fetch().then().done(() => { | |
| NetInfo.isConnected.addEventListener('change', dispatchConnected); | |
| }); | |
| } |
| pm2 start app.js --interpreter ./node_modules/.bin/babel-node |
| RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache | |
| npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache | |
| Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache |
| { | |
| "presets": ["es2015"], | |
| "plugins": ["transform-runtime"] | |
| } |
| /* | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2016 Esa-Matti Suuronen <esa-matti@suuronen.org> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. |
| // Get all users | |
| var url = "http://localhost:8080/api/v1/users"; | |
| var xhr = new XMLHttpRequest() | |
| xhr.open('GET', url, true) | |
| xhr.onload = function () { | |
| var users = JSON.parse(xhr.responseText); | |
| if (xhr.readyState == 4 && xhr.status == "200") { | |
| console.table(users); | |
| } else { | |
| console.error(users); |
| #!/bin/sh | |
| wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.15-osx10.11-x86_64.tar.gz | |
| tar xfvz mysql-5.7* | |
| echo "stopping mamp" | |
| sudo /Applications/MAMP/bin/stop.sh | |
| sudo killall httpd mysqld | |
| echo "creating backup" |