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
This file contains hidden or 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
| #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 { |
This file contains hidden or 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
| 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() |
This file contains hidden or 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 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 |
This file contains hidden or 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 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-- |