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
#auto adjusting column width of cells for openpyxl 3.0 | |
for column_cells in ws.columns: | |
unmerged_cells = list(filter(lambda cell_to_check: cell_to_check.coordinate not in ws.merged_cells, column_cells)) | |
length = max(len(str(cell.value)) for cell in unmerged_cells) | |
ws.column_dimensions[unmerged_cells[0].column_letter].width = length * 1.2 |
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
{ | |
"/{proxy+}": { | |
"x-amazon-apigateway-any-method": { | |
"produces": [ | |
"application/json" | |
], | |
"parameters": [ | |
{ | |
"name": "proxy", | |
"in": "path", |
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
#how to run app in docker | |
#docker build -t <name> . | |
#docker run -p 3000:3000 <name> | |
FROM node:6-alpine | |
# Create app directory | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app |
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
#bin/bash | |
CURRENT_DATE=`date +%s` | |
echo "current date is $CURRENT_DATE" | |
DEPLOYMENT_DIR='{deployment directory}' | |
CURRENT_DEPLOYMENT_DIR=$DEPLOYMENT_DIR$CURRENT_DATE | |
ARTIFACT_ZIP_LOCATION=~/tmp/ | |
echo "current deployment dir $CURRENT_DEPLOYMENT_DIR" | |
PM2_PROCESS_NAME='{process name}' | |
mkdir -p $CURRENT_DEPLOYMENT_DIR | |
cp $ARTIFACT_ZIP_LOCATION/web.tar.gz $CURRENT_DEPLOYMENT_DIR |
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
var google = require('googleapis'); | |
var googleAuth = require('google-auth-library'); | |
var mimelib = require("mimelib"); | |
let btoa = require('btoa'); | |
// If modifying these scopes, delete your previously saved credentials | |
// at ~/.credentials/sheets.googleapis.com-nodejs-quickstart.json | |
var SCOPES = ['https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/gmail.send']; | |
var key = require('./client_secret.json'); | |
var jwtClient = new google.auth.JWT(key.client_email, null, key.private_key, SCOPES, null); |
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
let shell = require('shelljs'); | |
const path = require('path'); | |
const rootDir = path.resolve('./'); | |
const alreadyCopied = (module, deployDir) => { | |
return shell.test('-d', deployDir + '/node_modules/' + module); | |
} | |
function copyDeps(packageFile, deployDir){ | |
let moduleDeps = require(packageFile).dependencies; |