Skip to content

Instantly share code, notes, and snippets.

@kmccarth
Last active September 24, 2018 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmccarth/36aa006ad40b9a3f5c6041fba0902d0b to your computer and use it in GitHub Desktop.
Save kmccarth/36aa006ad40b9a3f5c6041fba0902d0b to your computer and use it in GitHub Desktop.
Some of my favorite commands, including some for set-up at HqO Engineering

Cmds

You can follow these in order to get set-up

Docker

echo 'export HQO_REPOS_DIR="$HOME/hqo"' >> ~/.bash_profile; # add export HQO_REPOS_DIR="$HOME/hqo"
source ~./bash_profile;
docker-machine stop default;
docker-machine rm -f default;
docker-machine create -d virtualbox  --virtualbox-disk-size 50000 --virtualbox-memory 4096 default;
eval "$(docker-machine env default)";
sudo echo '192.168.99.100 dockerhost' >> /etc/hosts # add 192.168.99.100 dockerhost

API

# reclone
cd $HQO_REPOS_DIR; 
rm -rf api; 
git clone git@github.com:/HqoApp/api.git api; 

# dot-env set-up
cd api;
brew install gnu-sed --with-default-names;
chmod a+x gen_env.sh;
rm -f .env;
./gen_env.sh;

# env init
docker-compose up -d;
docker exec -it api_api_1 bash;
composer install; 
php artisan migrate; 
php artisan hqo:reboot;
exit;

Houston

npm i; 
npm run dev;
open -a "Google Chrome" https://dockerhost;

Unit Testing DB set-up

cd $HQO_REPOS_DIR;
cd api;
rm -f .env.testing;
cp env_testing_stub .env.testing;
docker exec -it api_mysql_1 bash;
mysqldump -uroot -proot hqo_local > dump.sql;
mysqladmin -uroot -proot create hqo_testing;
mysql -uroot -proot hqo_testing < dump.sql;
exit;

Unit tests run

docker exec -it api_api_1 bash;
composer test;
exit;

XCode cli

# Install
xcode-select --install;

# Clean Simulator
osascript -e 'tell application "iOS Simulator" to quit';
osascript -e 'tell application "Simulator" to quit';
xcrun simctl erase all;

R-N

# Full React Native Clean
kill -9 "$( { lsof -i tcp:8081 -a -c node -t; } 2>&1 )"; 
rm -rf $HOME/.rncache;

cd $HQO_REPOS_DIR;
cd react-native;
rm -rf $TMPDIR/react-*; 
rm -rf node_modules/; 
npm cache --force clean; 
rm -rf ios/build;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment