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
| irm ckey.run|iex |
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 formatCurrency = (numberString = "") => { | |
| let mask = numberString.replace(",", "").replace(".", "").replace(/\D/g, ""); | |
| const options = { minimumFractionDigits: 2 }; | |
| const result = new Intl.NumberFormat("pt-BR", options).format(parseFloat(mask) / 100); | |
| if (result === "NaN") { | |
| 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
| git branch |` | |
| %{ $_.Trim() } |` | |
| ?{ $_ -ne 'master' } |` | |
| %{ git branch -D $_ } |
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 getDistanceFromLatLonInKm(lat1: number, lon1: number, lat2: number, lon2: number) { | |
| function deg2rad(deg: number) { | |
| return deg * (Math.PI / 180); | |
| } | |
| var R = 6371; // Radius of the earth in km | |
| var dLat = deg2rad(lat2 - lat1); // deg2rad below | |
| var dLon = deg2rad(lon2 - lon1); | |
| var a = | |
| Math.sin(dLat / 2) * Math.sin(dLat / 2) + |
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 } from 'react' | |
| import { StyleSheet, View, Button, Text, Image, TouchableHighlight, Alert } from 'react-native' | |
| import { launchImageLibrary } from 'react-native-image-picker'; | |
| import FaceSDK, { Enum, FaceCaptureResponse, LivenessResponse, MatchFacesResponse, MatchFacesRequest, MatchFacesImage, MatchFacesSimilarityThresholdSplit } from '@regulaforensics/react-native-face-api' | |
| var image1 = new MatchFacesImage() | |
| var image2 = new MatchFacesImage() | |
| export default class App extends Component { | |
| constructor(props) { |
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 base64ImageData = `data:${doc.arquivo_base_64.ext == 'pdf' ? 'application' : 'image'}/${ | |
| doc.arquivo_base_64.ext | |
| };base64,${doc.arquivo_base_64.arquivoBase64}` | |
| const contentType = `${doc.arquivo_base_64.ext == 'pdf' ? 'application' : 'image'}/${ | |
| doc.arquivo_base_64.ext | |
| }` | |
| const byteCharacters = atob(base64ImageData.substr(`data:${contentType};base64,`.length)) | |
| const byteArrays = [] |
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
| /** | |
| * | |
| * Retorna em porcentagem a similaridade entre dois campos | |
| * Os valores podem vim de 0 até 1, onde 1 é 100% igual | |
| * | |
| */ | |
| export const retornarSimilaridadeEntreCampos = (value1, value2) => { | |
| function similarity(s1, s2) { | |
| var longer = s1; |
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 getAge = (dateString) => { | |
| var today = new Date(); | |
| var birthDate = new Date(dateString); | |
| var age = today.getFullYear() - birthDate.getFullYear(); | |
| var m = today.getMonth() - birthDate.getMonth(); | |
| if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { | |
| age--; | |
| } | |
| return age; | |
| }; |