This file contains 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 { isNumeric } from "@core/Utils/index"; | |
const DateDuration = function (milliseconds?: number, hasSeconds = true, hasMinutes = true): string { | |
if (!milliseconds) { | |
return "0s"; | |
} | |
if (milliseconds <= 0 || milliseconds === Infinity) { | |
return "0s"; | |
} |
This file contains 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 { subDays, format, parse, startOfWeek, addWeeks, startOfMonth, subMonths, subWeeks, addMonths, addDays } from "date-fns"; | |
import { ReportFields } from "../WindowDeviceReport.asset"; | |
const getDateRangeFromPresets = function ({ range, timeRange, startTime: customStartTime, endTime: customEndTime, customRange }: ReportFields) { | |
const rangeToOffset = { | |
today: [new Date(), new Date()], | |
yesterday: [subDays(new Date(), 1), subDays(new Date(), 1)], | |
two_days_ago: [subDays(new Date(), 2), subDays(new Date(), 2)], | |
three_days_ago: [subDays(new Date(), 3), subDays(new Date(), 3)], |
This file contains 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 jsPDF from "jspdf"; | |
import html2canvas from "html2canvas"; | |
import { ServicePdfComponentsImage } from "@core/Services/Pdf/Components"; | |
type ImagesStructure = { | |
id: string; | |
positions: [ | |
{ | |
page: number; |
This file contains 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
=============== CNUCASH =================== | |
CREATE TABLE TRANSACTION ( | |
ID VARCHAR(256) NOT NULL, | |
NUM VARCHAR(256), | |
DESCRIPTION VARCHAR(512), | |
DATE CHAR(10) | |
) | |
CREATE TABLE SPLIT ( | |
ID VARCHAR(256) NOT NULL, |
This file contains 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 { DocumentData, DocumentSnapshot, QuerySnapshot } from "firebase-admin/firestore"; | |
type withDocId<T> = T & { docId: string } | |
type SingleDocument = DocumentSnapshot<DocumentData>; | |
type QueryDocuments = QuerySnapshot<DocumentData>; | |
type Snapshot = SingleDocument | QueryDocuments; | |
type SnapshotNullable = Snapshot | null; | |
const checkSingle = (snapshot: Snapshot): snapshot is SingleDocument => { |
This file contains 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
POST https://api.melhorrastreio.com.br/graphql HTTP/1.1 | |
Content-Type: application/json | |
{ | |
"query": "mutation searchParcel ($tracker: TrackerSearchInput!) { result: searchParcel (tracker: $tracker) { id createdAt updatedAt lastStatus lastSyncTracker trackingEvents { createdAt translatedEventId originalTitle to from location { zipcode address locality number complement city state country } additionalInfo } } }", | |
"variables": { | |
"tracker": { | |
"trackingCode": "CODIGO_CORREIOS", | |
"type": "correios" | |
} |
This file contains 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 userSnapshot = useRef<Unsubscribe|null>(null); | |
const [isFirstUser, setIsFirstUser] = useState(false); | |
const [firstUserFinded, setFirstUserFinded] = useState(false); | |
useEffect(function () { | |
if (userSnapshot.current && firstUserFinded) { | |
userSnapshot.current(); |
This file contains 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
// history | |
alert: history.alrm || history.alrt || "no_alert", | |
event: String(history.evt || history.res || "no_event"), | |
acceleration, | |
rpm, | |
date, | |
driver, | |
engine, | |
locked, | |
moving, |
This file contains 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
{ | |
by: "", | |
active: true, | |
static: false, | |
name: "", | |
description: "", | |
permissions: { | |
// Permissões sobre nodes abaixo | |
// (passível de ser removido, feito agora por `type` na node) | |
clients: { read: true, write: true, delete: true }, |
NewerOlder