- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
npm install --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
npm install --dev jest babel-jest @babel/preset-env @babel/preset-react
| exports.deleteUser = async (req, res, next) { | |
| const session = await mongoose.startSession(); | |
| try { | |
| const { id } = req.params; | |
| // Start session | |
| await session.startTransaction(); | |
| // deleteMany in this session | |
| const [errorOp, result] = await toAll([App.deleteMany({ user: id }).session(session), UserModel.findByIdAndRemove(id).session(session)]); | |
| if (errorOp) { | |
| throw new ErrorRequest(STATUS_CODE.UNPROCESSABLE, errorOp.message); |
See also:
| Service | Type | Storage | Limitations |
|---|---|---|---|
| Amazon DynamoDB | 25 GB | ||
| Amazon RDS | |||
| Azure SQL Database | MS SQL Server | ||
| 👉 Clever Cloud | PostgreSQL, MySQL, MongoDB, Redis | 256 MB (PostgreSQL) | Max 5 connections (PostgreSQL) |
| /** set up our navbar, and position it fixed so there is no white gap above the CS content **/ | |
| .x-navbar { | |
| border: none; | |
| box-shadow: none; | |
| transition: background 0.7s ease-out; | |
| background: transparent!important; | |
| position: fixed; | |
| z-index: 1030; | |
| top: 0; |
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
| const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))) | |
| // Usage : compose functions right to left | |
| // compose(minus8, add10, multiply10)(4) === 42 | |
| // | |
| // The resulting function can accept as many arguments as the first function does | |
| // compose(add2, multiply)(4, 10) === 42 |
Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.
For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.
This gives an ongoing list of file-type magic numbers.