This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/code_templates/component.js | |
import React from 'react'; | |
import './COMPONENT_NAME.scss'; | |
function COMPONENT_NAME() { | |
return <div>Hello</div>; | |
} | |
export default COMPONENT_NAME; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#getExport-property | |
const fs = require("fs"); | |
const AWS = require("aws-sdk"); | |
const path = require("path"); | |
const apigateway = new AWS.APIGateway({ | |
apiVersion: "2015-07-09", | |
region: "us-east-1" | |
}); | |
const getExport = params => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "edit0", | |
"Effect": "Allow", | |
"Action": [ | |
"lambda:CreateFunction", | |
"lambda:List*", | |
"lambda:Get*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p src/components/$1 | |
touch src/components/$1/$1.scss | |
sed -e "s/COMPONENT_NAME/$1/g" ~/code_templates/component.js > src/components/$1/index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias l='ls -lah' | |
alias gac='git add . && git commit -am' | |
alias gi='git init && gac "init"' | |
alias gc='git checkout' | |
alias glo='git pull origin' | |
alias gd='gc develop && glo develop && gc master && glo master && git merge develop && git push' | |
alias prt='prettier --write ./*.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04 | |
# https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04 | |
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04 | |
# https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04#installing-the-oracle-jdk | |
# https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-18-04 | |
# install nginx | |
sudo apt update | |
sudo apt install nginx | |
sudo ufw app list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#for dev and prod stage, dont forget to install jq | |
aws apigateway get-rest-apis | jq '.items[].id' | sed s/\"// | sed s/\”// > api_ids.txt | |
for i in $(cat api_ids.txt); | |
do aws apigateway get-export --parameters extensions='postman' --rest-api-id $i --stage-name prod --export-type swagger ./apis/lambda/prod/$i.json; | |
echo $i ; | |
done ; | |
for i in $(cat api_ids.txt); | |
do aws apigateway get-export --parameters extensions='postman' --rest-api-id $i --stage-name dev --export-type swagger ./apis/lambda/dev/$i.json; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.1' | |
services: | |
mongo: | |
container_name: mongo | |
image: mongo | |
volumes: | |
- /data/db/mongo | |
ports: | |
- '27017:27017' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exec = require('child_process').exec; | |
const shell = (cmd) => { | |
const script = exec(cmd, | |
(error, stdout, stderr) => { | |
if (error !== null) { | |
console.error(error); | |
} | |
}); | |
script.stdout.pipe(process.stdout); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get upgrade | |
usermod -aG sudo ghost | |
su - ghost | |
sudo apt-get install nginx | |
sudo ufw allow 'Nginx Full' | |
sudo apt-get install mysql-server | |
# To set a password, run | |
sudo mysql | |
# and login to your Ubuntu user again |