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
| # Hey there o/! | |
| # | |
| # We just wanted to let you know that we care a great deal about | |
| # making our git history clean, maintainable and easy to access for | |
| # all our contributors. Commit messages are very important to us, | |
| # which is why we have a strict commit message policy in place. | |
| # Please use the following guidelines to format all your commit | |
| # messages: | |
| # | |
| # <type>(<scope>): <subject> |
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
| # [<tag>] (If applied, this commit will...) <subject> (Max 72 char) | |
| # |<---- Preferably using up to 50 chars --->|<------------------->| | |
| # Example: | |
| # [feat] Implement automated commit messages | |
| # (Optional) Explain why this change is being made | |
| # |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
| # (Optional) Provide links or keys to any relevant tickets, articles or other resources | |
| # Example: Github issue #23 |
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
| { | |
| "name": "banka", | |
| "version": "1.0.0", | |
| "description": "An App to handle core banking applications", | |
| "main": "server/app.js", | |
| "scripts": { | |
| "start": "babel-node server/app.js", | |
| "bootcamp:build": "babel server/app.js -d build && build/server/app.js", | |
| "ayo": "nodemon server/helpers/Authenticator.js --exec babel-node --presets babel-preset-env ", | |
| "dev": "nodemon server/app.js --exec babel-node --presets babel-preset-env", |
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
| import { Pool } from 'pg'; | |
| import dotenv from 'dotenv'; | |
| dotenv.config(); | |
| // const config = { | |
| // development: process.env.DEVELOPMENT_URL, | |
| // test: process.env.TEST_URL, | |
| // production: process.env.PRODUCTION_URL, | |
| // }; |
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
| GIT | |
| `git stash apply` --- to get back git stash | |
| `` |
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
| plugins: | |
| duplication: | |
| enabled: true | |
| checks: | |
| argument-count: | |
| config: | |
| threshold: 4 | |
| complex-logic: | |
| config: | |
| threshold: 4 |
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
| // Updating | |
| const { accountId } = req.params; | |
| const account = accounts.find(singleAccount => singleAccount.accountNumber === accountId); | |
| // Handle cases where account with such an accountNumer is not found | |
| if (!account) { | |
| return res.status(400).json({ | |
| status: 'error', |
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
| //Deleting | |
| const { accountId } = req.params; | |
| const account = accounts.find(singleAccount => singleAccount.accountId === accountId); | |
| // Handle cases where account with such an accountId is not found | |
| if (!account) { | |
| return res.status(400).json({ | |
| status: 'error', | |
| message: 'No account with the given email', |
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
| // Checking if object.key is same as a variable | |
| const user = { | |
| email: "John@example.com", | |
| password: "123pass", | |
| } | |
| Object.entries(user).forEach(([key, value]) => { | |
| console.log(`${key} ${value}`); | |
| if (user.email === 'John@example.com') { | |
| return user; |
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
| Task | |
| Finish the function numberToOrdinal, which should take a number and return it as a string with the correct ordinal indicator suffix (in English). For example, 1 turns into "1st". | |
| For the purposes of this challenge, you may assume that the function will always be passed a non-negative integer. If the function is given 0 as an argument, it should return '0' (as a string). | |
| To help you get started, here is an excerpt from Wikipedia's page on Ordinal Indicators: | |
| st is used with numbers ending in 1 (e.g. 1st, pronounced first) | |
| nd is used with numbers ending in 2 (e.g. 92nd, pronounced ninety-second) | |
| rd is used with numbers ending in 3 (e.g. 33rd, pronounced thirty-third) |