Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
const testString = 'hello'; | |
const reverse = (s) => { | |
let arr = Array.from(s), | |
left = 0, | |
right = arr.length - 1; | |
while (left < right) { | |
[arr[left], arr[right]] = [arr[right], arr[left]] | |
left++ | |
right-- |
// For a detailed explanation regarding each configuration property, visit: | |
// https://jestjs.io/docs/en/configuration.html | |
// declaring node_env globally | |
process.env.NODE_ENV = 'testing'; | |
// script for package.json | |
"test": "cross-env NODE_ENV=testing jest --watch --verbose --runInBand", | |
module.exports = { | |
// All imported modules in your tests should be mocked automatically |
heroku login # login once
heroku create [name] # Initializes heroku app and adds remote.
heroku addons:create heroku-postgresql:[plane-name] -app [project-name] # add a postgres db addon to your heroku app where plane-name = hobby-dev
heroku logs [--tail] # Shows heroku server terminal
heroku pg:psql # connect to heroku addon database server
heroku config # shows heroku environment variables
- heroku config:set clown=fiesta # set a config variable
function rot13(str) { | |
const splitStr = str.split('') | |
let finalArr = [] | |
for(let i = 0; i < splitStr.length; i++){ | |
for(let j = 0; j < splitStr[i].split('').length; j++){ | |
const currentValueCode | |
= splitStr[i] | |
.split('')[j] | |
.charCodeAt() |
#bg { | |
background: url("~assets/img/bg-img.jpg") no-repeat center center fixed; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
-o-background-size: cover; | |
background-size: cover; | |
position: relative; | |
background-color: grey; | |
&:before { |