import databaseConfig from './config/database.config';
@Module({
imports: [
ConfigModule.forRoot({
load: [databaseConfig],
}),| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta charset="UTF-8"> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | |
| <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script> | |
| <style> |
| #!/bin/bash | |
| if [ ! $1 ]; then | |
| echo " Example of use: $0 database_name dir_to_store" | |
| exit 1 | |
| fi | |
| db=$1 | |
| out_dir=$2 | |
| if [ ! $out_dir ]; then | |
| out_dir="./" |
When it comes to linting TypeScript code, there are two major linting options to choose from: TSLint and ESLint. TSLint is a linter that can only be used for TypeScript, while ESLint supports both JavaScript and TypeScript. For that reason, I would recommend using ESLint for linting TypeScript projects. And another reason of using ESLint is, TSLint is deprecated in favour of ESLint
Install ESLint by running command below:
npm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-pluginFirst we need to ingnore node_modules from linting. Since we don't need to lint those files in the directory. Create .eslintignore file in root directory. Then add files/directory that we need to ignore just like .gitignore file.
| git_current_branch () { | |
| local ref | |
| ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null) | |
| local ret=$? | |
| if [[ $ret != 0 ]] | |
| then | |
| [[ $ret == 128 ]] && return | |
| ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
| fi | |
| echo ${ref#refs/heads/} |
| const crypto = require('crypto'); | |
| const algorithm = 'aes-256-ctr'; | |
| let key = 'MySuperSecretKey'; | |
| key = crypto.createHash('sha256').update(String(key)).digest('base64').substr(0, 32); | |
| const encrypt = (buffer) => { | |
| // Create an initialization vector | |
| const iv = crypto.randomBytes(16); | |
| // Create a new cipher using the algorithm, key, and iv | |
| const cipher = crypto.createCipheriv(algorithm, key, iv); |
| ############################################################################ | |
| # # | |
| # ------- Useful Docker Aliases -------- # | |
| # # | |
| # # Installation : # | |
| # copy/paste these lines into your .bashrc or .zshrc file or just # | |
| # type the following in your current shell to try it out: # | |
| # wget -O - https://gist.github.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash | |
| # # | |
| # # Usage: # |
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
| docker exec -it container-name redis-cli FLUSHALL |
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
