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 moment from 'moment'; | |
| const seconds = 108000; | |
| const duration = moment.duration(seconds, 'seconds'); | |
| const output = { | |
| h: Math.floor(duration.asHours()), | |
| m: duration.minutes(), | |
| s: duration.seconds() |
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 transactions = [ | |
| { | |
| date: '2023-03-20', | |
| description: 'Restaurante X-Burger', | |
| amount: -30 | |
| }, | |
| { | |
| date: '2023-03-20', | |
| description: 'Cinema', | |
| amount: -45 |
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 course = { | |
| "id": 1, | |
| "title": "Vue.js composition API", | |
| "sections": [ | |
| { | |
| "id": 1, | |
| "title": "Introdução", | |
| "lectures": [ | |
| { | |
| "id": 1, |
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
| // Faça o calculo do total destes produtos que estão no carrinho | |
| const cart = [ | |
| { | |
| name: 'Pizza de calebreza', | |
| amount: 10, | |
| qty: 2, | |
| addons: [ | |
| { | |
| 'name': 'Extra calabreza', | |
| 'amount': 1.5 |
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
| // config/passport.js | |
| // load all the things we need | |
| var LocalStrategy = require('passport-local').Strategy; | |
| var mysql = require('mysql'); | |
| var connection = mysql.createConnection({ | |
| host : 'localhost', | |
| user : 'root', |