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 { | |
| pipe, match, drop, head, range, map, identity, add | |
| , equals, last, join, take, ifElse, adjust, always | |
| } = require('ramda') | |
| const leftPad = require('left-pad') | |
| const leftPadZero = size => x => leftPad(x, size, '0') | |
| const clockToFullHours = | |
| pipe( | |
| match(/^(\d{1,2}):(\d{2})(\w{2})$/i) |
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 CODE_A = 65 | |
| const ALPHABET = [...Array.from({"length": 26}).keys()].map(key => String.fromCharCode(CODE_A + key)) | |
| const getCharIndex = (letter) => letter.charCodeAt(0) - CODE_A | |
| const findNextChar = (index) => (changeTo) => | |
| ALPHABET[(index + changeTo) % 26] | |
| const getChar = (char) => (changeTo = 0) => { | |
| return getCharIndex(char) >= 0 | |
| ? findNextChar(getCharIndex(char))(changeTo) | |
| : char | |
| } |
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 testaPost(){ | |
| const url = '/includes/curl2.php' | |
| const data = { | |
| username: 'lubien', | |
| password: '123456', | |
| data: `<?xml version='1.0'?> | |
| <methodCall> | |
| <methodName>RequestServer.GetTableState</methodName> | |
| <params> | |
| <param> |
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 create = (userUID, customerObj) => { | |
| const ref = database | |
| .ref('user_data') | |
| .child(userUID) | |
| .child('customers') | |
| .push() | |
| const {key} = ref | |
| return ref.set(customerObj) |
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 getAll = userUID => | |
| database | |
| .ref('user_data') | |
| .child(userUID) | |
| .child('customers') | |
| // exemplo de uso: | |
| getAll(myUserId).on('value', snap => { | |
| const value = snap.val() |
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
| module.exports = { | |
| async signup(name, email, password) { | |
| const exists = await models.user.findOne({ where: { email } }) | |
| if (exists) { | |
| throw new Error({ error: 'E-mail já existe. Tente se registrar com outro.' }) | |
| } | |
| const passwordEncrypted = await hashing(password) |
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 lazyLoadingRoutes from '../../support/lazyLoadingRoutes' | |
| export default lazyLoadingRoutes([ | |
| { path: '/login', component: 'Login', meta: { requiresAuth: false } }, | |
| { path: '/forgotPassword', component: 'ForgotPassword', meta: { requiresAuth: false } }, | |
| { path: '/forgotEmail', component: 'ForgotEmail', meta: { requiresAuth: false } }, | |
| { path: '/createAccount', component: 'CreateAccount', meta: { requiresAuth: false } } | |
| ]) | |
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 arr = [ | |
| { | |
| id: 10, | |
| title: "Test 10", | |
| item: "Item 1" | |
| }, | |
| { | |
| id: 10, | |
| title: "Test 10", | |
| item: "Item 2" |
OlderNewer