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
Chrome >= 60 |
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
String.prototype.hashCode = function() { | |
var hash = 0, | |
i, chr; | |
if (this.length === 0) return hash; | |
for (i = 0; i < this.length; i++) { | |
chr = this.charCodeAt(i); | |
hash = ((hash << 5) - hash) + chr; | |
hash |= 0; // Convert to 32bit integer | |
} | |
return hash; |
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 { screen } from "@testing-library/vue"; | |
import { createTestComponentRenderer } from "~~core/test"; | |
import { mockNuxtImport } from "@nuxt/test-utils/runtime"; | |
import { routerKey, createRouter, createWebHistory } from '#vue-router'; | |
import { XButton } from "~~base-ui"; | |
let router: ReturnType<typeof createRouter>; | |
beforeEach(async () => { | |
router = createRouter({ |
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
// setupFiles.ts | |
const { warn, log } = console; | |
const fnOverride = (callback: Function, ...msg: Array<[]>) => { | |
// if (!Object.getPrototypeOf(msg[0])) return callback(...msg); | |
const shouldIgnore = !!msg.find((m) => /Vue|mountOptions|FetchError/gi.test(String(m))); | |
if (!shouldIgnore) callback(...msg); | |
} | |
console.warn = (...args) => fnOverride(warn, ...args); |
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 sortSignaturesByDiagonalDistance = (a, b) => { | |
// await nextTick(); | |
console.log('sort'); | |
if (!a.signatureRef) return 0; | |
// Get the absolute position of the child relative to the parent | |
const { top: distanceFromTopA, left: distanceFromLeftA } = a.signatureRef.getBoundingClientRect(); | |
const { top: distanceFromTopB, left: distanceFromLeftB } = b.signatureRef.getBoundingClientRect(); |
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 { processCoordinateForBackend } from '..'; | |
import { groupBy, merge } from 'lodash'; | |
export const useMountPositionSignPayload = (archives, signatures) => { | |
if (signatures.value.length === 0) { | |
return archives.value.reduce((acc, curr) => { | |
const url = curr.links.rubrics; | |
acc[url] ||= { rubric: [] }; |
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
/** @typedef {import("pdfjs-dist/lib/display/api.js").PDFDocumentProxy} PDFDocumentProxy */ | |
/** | |
* @param {String} pdfUrl | |
* @param {PDFDocumentProxy} documentProxy - pdf.js document proxy object | |
*/ | |
const handleGetPageSize = async ({ pdfUrl, documentProxy }) => { | |
const documentKey = archives.value.find((archive) => archive.documentPdfUrl === pdfUrl).key; | |
const pageBaseList = Array.from({ length: documentProxy.numPages }); | |
const pageOriginalSizePromise = pageBaseList.map(async (_item, index) => { |
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 { | |
isTimeElapsedBeforeEndTime, | |
getDateTimeElapsedSincePageLoaded, | |
getDurationBetweenTimes, | |
} from '@/utils/date'; | |
class myMap extends Map { | |
deleteByValue(valueToRemove) { | |
console.log('delete', this, valueToRemove) | |
this.forEach((value, key) => { |
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
#!/bin/bash | |
git diff --name-only --staged > .vscode/staged && \ | |
docker exec -i tavola bash -c "yarn eslint --fix $(cat .vscode/staged) | grep -E 'warning|error'; " && \ | |
docker exec -i tavola yarn run lint:styles --fix $(cat .vscode/staged) && \ | |
git add $(cat .vscode/staged) |
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 { query, emitEvent, setDaysToDate, getIsoDate } from '/static/assets/js/helpers.js'; | |
class DateField extends HTMLElement { | |
constructor() { | |
super(); | |
this.innerHTML = ` | |
<style> | |
</style> |
NewerOlder