Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.
I've tried to make it as lean and unobtrusive as possible.
errors/AppError.js
| const fs = require('fs'); | |
| const path = require('path'); | |
| const Sequelize = require('sequelize'); | |
| const basename = path.basename(module.filename); | |
| const sequelize = new Sequelize(process.env.DATABASE_URI); | |
| const models = fs.readdirSync(__dirname) | |
| .filter(file => (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js')) |
| FROM node:8.9.0-alpine | |
| WORKDIR /usr/src/app | |
| COPY package.json package-lock*.json npm-shrinkwrap*.json /usr/src/app/ | |
| RUN apk --no-cache add --virtual native-deps \ | |
| git g++ gcc libgcc libstdc++ linux-headers make python && \ | |
| npm install node-gyp -g &&\ | |
| npm install &&\ | |
| npm install nodemon &&\ | |
| npm rebuild bcrypt --build-from-source && \ | |
| npm cache clean --force &&\ |
| brew install youtube-dl | |
| youtube-dl --extract-audio --audio-format mp3 "https://www.youtube.com/watch?v=YVdC7nZ6LNY" | |
| ffmpeg -i "OUTPUT-OF-FIRST URL" -ss 00:00:15.00 -t 00:00:10.00 -c copy out.mp3 |
| FROM circleci/buildpack-deps:sid-curl | |
| RUN sudo curl -sLO https://storage.googleapis.com/kubernetes-release/release/v1.9.6/bin/linux/amd64/kubectl && sudo chmod +x kubectl && sudo mv kubectl /usr/bin | |
| RUN sudo curl -sLO https://github.com/kubernetes/kops/releases/download/1.9.0/kops-linux-amd64 && sudo chmod +x kops-linux-amd64 && sudo mv kops-linux-amd64 /usr/bin/kops | |
| RUN sudo apt-get update && sudo apt-get install -qq -y libpython-dev gettext docker python-pip python-setuptools wget | |
| RUN sudo curl -sO https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py | |
| RUN sudo pip install -q awscli --upgrade |
| adb tcpip 5555 | |
| adb connect <device ip addr>:5555 | |
| adb devices |
I hereby claim:
To claim this, I am signing this object:
| #============================================================================= | |
| # dark_powered.toml --- dark powered configuration example for SpaceVim | |
| # Copyright (c) 2016-2017 Wang Shidong & Contributors | |
| # Author: Wang Shidong < wsdjeg at 163.com > | |
| # URL: https://spacevim.org | |
| # License: GPLv3 | |
| #============================================================================= | |
| # All SpaceVim option below [option] section | |
| [options] |
| black = '#0B0D0F'; | |
| red = '#FF9580'; | |
| green = '#8AFF80'; | |
| yellow = '#FFFF80'; | |
| blue = '#9580FF'; | |
| magenta = '#FF80BF'; | |
| cyan = '#80FFEA'; | |
| white = '#F8F8F2'; | |
| lightBlack = '#0B0D0F'; | |
| lightRed = '#FFAA99'; |