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 { createRouter, createWebHistory } from 'vue-router' | |
const routes = [] | |
const router = createRouter({ | |
history: createWebHistory(), | |
routes | |
}) | |
let dbPromise |
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
<template> | |
<div ref="div"> | |
<label> | |
<strong v-if="progress === 0"> | |
{{ label }} | |
<svg width="24" height="24" viewBox="0 0 24 24"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/><path d="M0 0h24v24H0z" fill="none"/></svg> | |
</strong> | |
<strong v-if="progress > 0 && progress < 100"> {{ progress }}%</strong> | |
<span v-else>{{ name }}</span> | |
<input ref="input" type="file" :accept="accept" @change="onFileChange"/> |
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
export default { | |
install: (app, options) => { | |
let observer | |
const obj = { | |
created(el, binding) { | |
if (options?.observe) { | |
el.setAttribute('elementtiming', binding.arg) | |
observer = new PerformanceObserver(list => { | |
for (const entry of list.getEntries()) { | |
const { identifier, loadTime } = entry |
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
ARG VERSION=12.10.0 | |
# Development ################################################################## | |
FROM mhart/alpine-node:${VERSION} AS dev | |
WORKDIR /app | |
COPY package*.json .gitignore ./ | |
ENV HOST=0.0.0.0 | |
ENV PORT=${PORT} | |
RUN npm ci --prefer-offline | |
COPY . . |
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
module.exports = { | |
apps : [{ | |
name: 'API', | |
script: 'app.js', | |
// Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/ | |
args: 'one two', | |
instances: 1, | |
autorestart: true, | |
watch: false, |
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
/* css variables does't work in math... */ | |
/* using postcss-simple-vars */ | |
$a: -0.0223; | |
$b: 0.185; | |
$c: -0.1745; | |
$lineHeight: 1.4; | |
$fontSize: 16; | |
@import url('https://rsms.me/inter/inter.css'); |
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 transformer = options => ({ | |
apply: 'post', | |
transform({ code, isBuild }) { | |
if (!isBuild) return code | |
return code.replace('</body>', `<script defer type="module"> | |
const KEY = 'ga:user' | |
const UID = (localStorage[KEY] = localStorage[KEY] || Math.random() + '.' + Math.random()) | |
const onError = err => console.error('[vite vitals] ', err) | |
const onDebug = (label, payload) => console.log(label, payload) |
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 amqp = require('amqplib') | |
const eventEmitter = require('events') | |
class OopsEmitter extends eventEmitter {} | |
const oopsEmitter = new OopsEmitter() | |
;(async () => { | |
try { | |
const conn = await amqp.connect('amqp://localhost?heartbeat=5s') | |
const ch = await conn.createChannel() |
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
export default function (locale, path, ...args) { | |
return (path, ...args) => { | |
const keys = path.trim().split('.') | |
const fn = keys.reduce((prev, curr) => prev && prev[curr], locale) | |
return typeof fn === 'function' ? fn(...args) : fn | |
} | |
} | |
// export default function(t,e,...n){return(e,...n)=>{const r=e.trim().split(".").reduce((t,e)=>t&&t[e],t);return"function"==typeof r?r(...n):r}} |
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
{ | |
"scripts": { | |
"test": "vitest" | |
}, | |
"devDependencies": { | |
"vitest": "^0.24.3" | |
} | |
} |
NewerOlder