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, { memo, useState, useEffect } from 'react' | |
| import memoize from 'memoize-one' | |
| import isEqual from 'lodash.isequal' | |
| const equalFn = (newArg, lastArg) => isEqual(newArg, lastArg) | |
| const range = (start, end) => [...Array(end - start).keys()].map(k => k + start) | |
| const getPager = memoize((totalItems, currentPage, pageSize) => { |
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 styled from 'styled-components' | |
| import { width, height, lineHeight } from 'styled-system' | |
| export const TableContainer = styled.div` | |
| border: none; | |
| @media (min-width: 768px) { | |
| border: 1px solid hsla(216, 20%, 48%, 0.12); | |
| } | |
| ` |
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 const FormatCpf = props => { | |
| let formatedCpf = props.children | |
| if (!formatedCpf) return '' | |
| if (formatedCpf.length === 11) | |
| formatedCpf = `${formatedCpf.substr(0, 3)}.${formatedCpf.substr(3, 3)}.${formatedCpf.substr(6, 3)}-${formatedCpf.substr(9, 2)}` | |
| return formatedCpf | |
| } | |
| export const FormatCnpj = props => { | |
| let formated = props.children |
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, { memo, useState, useEffect } from 'react' | |
| import Input from './Input' | |
| const maskValue = (value = '') => { | |
| value = value.toString() | |
| value = value.replace(/\D/g, '') | |
| if (!value) return '' |
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, { useEffect } from 'react' | |
| import Modal from '../components/StyledModalAlert' | |
| const Alert = ({autoHideDuration = 3000, open, message, onClose}) => { | |
| return ( | |
| <> | |
| {open && ( | |
| <Modal | |
| hasBackdrop={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
| import React, { useRef } from 'react' | |
| import styled from 'styled-components' | |
| const Checkbox = ({ checked, checkAnimation, uncheckAnimation, ...rest }) => { | |
| const checkboxRef = useRef() | |
| const checkRef = useRef() | |
| const handleClick = () => { | |
| if (checked) { | |
| if (uncheckAnimation) { |
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, { Component, useCallback, useState, useRef } from "react"; | |
| import "./App.css"; | |
| const imgUrl = require("./assets/iPhone-XS-Portrait-Space-Gray.png"); | |
| const fullSize = { | |
| width: 1325, | |
| height: 2616 | |
| }; |
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() { | |
| if (window._PagSeguroDirectPayment) { | |
| return; | |
| } | |
| function onDocumentReady(callback) { | |
| var eventName = document.addEventListener ? "DOMContentLoaded" : "onreadystatechange"; | |
| if (document.readyState === "complete" || (document.readyState !== "loading" && !document.attachEvent)) { | |
| callback(); | |
| return; |
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
| #!/bin/sh | |
| # $ crontab -e | |
| # 0 3 * * * /bin/bash -l -c '/home/deployer/.backups/backup.sh' &>/dev/null | |
| DATABASE_NAME="" | |
| DATABASE_PASSWORD="" | |
| USER="deployer" | |
| NOW="$(date +'%Y.%m.%d.%H.%M.%S')" | |
| FILE_NAME="db_backup_$NOW".gz |
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
| #!/bin/sh | |
| # $ cd && mkdir .backups && cd .backups | |
| # $ wget --no-check-certificate https://gist.githubusercontent.com/.../backup.sh | |
| # $ sed -i -e 's/BACKUP_FOLDER/\/home\/deployer\/.backups/g' backup.sh | |
| # $ sed -i -e 's/DATABASE_PASSWORD/YourPassword/g' backup.sh | |
| # $ sed -i -e 's/DATABASE_NAME/YourDataBaseName/g' backup.sh | |
| # $ sed -i -e 's/USER/deployer/g' backup.sh | |
| # $ sed -i -e 's/PROJECT_NAME/YourProjectName/g' backup.sh | |
| # $ sed -i -e 's/EMAIL/[email protected]/g' backup.sh |