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 findKeyInFlattenObject = (labelKey) => ([key]) => key.endsWith(labelKey); | |
const getHeaderLabel = (obj) => { | |
const flattenObject = dot.dot(obj); | |
const [_, value] = Object.entries(flattenObject).find(findKeyInFlattenObject('name')); | |
return value; | |
} | |
const headerLabels = headerArray.map(getHeaderLabel('name')); |
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 * as React from 'react' | |
import MUIOutlinedInput from '@material-ui/core/OutlinedInput'; | |
import FormControl from '@material-ui/core/FormControl'; | |
import styled, { css } from 'styled-components'; | |
import { connect, FormikContext, getIn } from 'formik' | |
import FormHelperText from '@material-ui/core/FormHelperText'; | |
import MaskedInput from 'react-text-mask' | |
import InputAdornment from '@material-ui/core/InputAdornment'; | |
import Visibility from '@material-ui/icons/Visibility'; | |
import VisibilityOff from '@material-ui/icons/VisibilityOff'; |
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 React from 'react' | |
class Filho extends React.Component { | |
render() { | |
return ( | |
<div onClick={this.props.updatePai}> | |
FILHO | |
</div> | |
) |
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
#include <stdio.h> | |
#include <math.h> | |
void swap (double* a, double* b) { | |
double aux = *b; | |
*b = *a; | |
*a = aux; | |
} | |
int main(){ |
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 findOnePedido = async (clienteId) => { | |
try { | |
var pedidoFind = await Pedido.findOne({clienteId}).lean(); | |
if(pedidoFind) { | |
return false | |
} | |
return true | |
} catch (error) { | |
return 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 findOnePedido = async (clienteId) => { | |
try { | |
var pedidoFind = await Pedido.findOne({clienteId}).lean(); | |
if(pedidoFind) { | |
return false | |
} | |
return true | |
} catch (error) { | |
return 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
struct LinkedListNode { | |
int dest; | |
struct LinkedListNode* next; | |
}; | |
struct LinkedList { | |
unsigned int label; | |
bool has_reached; | |
struct LinkedListNode *node; | |
}; |
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
var uploadFile = function(req, res){ | |
var responseMessages = new serverResponse(), | |
clientId = req.params.clientId, | |
form = new formidable.IncomingForm(); | |
form.keepExtensions = true; | |
form.uploadDir = path.join(__dirname, '../balanceSheets/tmp'); | |
form.on('file', function(field, file) { | |
//console.log(file, field) |
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
export default = [ | |
'ADMIN', | |
'RESOURCE_A', | |
'RESOURCE_B', | |
'RESOURCE_A:CREATE', | |
'RESOURCE_A:READ', | |
'RESOURCE_B:CREATE', | |
'RESOURCE_B:READ', | |
] |
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 schema = new mongoose.Schema( | |
{ | |
// other schema props | |
roles: { | |
type: [String], | |
default: [], | |
required: true, | |
}, | |
} | |
); |