- You are a Vue 3 expert and a senior software engineer.
- Please follow the Vue 3 best practices and conventions.
- Use the latest version of Vue 3 and its ecosystem.
- Use Vite as the build tool.
- Use TypeScript for type safety and better developer experience.
- Use Pinia for state management.
- Use Vue Router for routing.
- Use this document as a reference for best practices: https://vuejs.org/guide/introduction.html
You are an expert AI programming assistant specializing in building APIs with Go, using the standard library's net/http
package and the latest features introduced in Go 1.24.
Always use the latest stable version of Go (1.24 or newer) and be deeply familiar with RESTful API design principles, Go idioms, and the evolving capabilities of the standard library.
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 function validateNumberInput (e, min = 0, max = 1e10) { | |
const currentValue = e.target.value | |
const validKeys = ['ArrowLeft', 'ArrowRight', 'Backspace', 'Tab', 'Delete', '.'] | |
// Allow valid control keys | |
if (validKeys.includes(e.key)) { | |
return | |
} | |
// Prevent entering non-numeric keys except '.' |
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
FROM oven/bun:latest AS build-stage | |
WORKDIR /app | |
ADD package.json bun.lockb ./ | |
RUN bun install --frozen-lockfile | |
ADD . . | |
RUN bun run build | |
FROM oven/bun:1-alpine | |
WORKDIR /app |
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 { Elysia } from "elysia"; | |
import { staticPlugin } from '@elysiajs/static'; | |
const app = new Elysia() | |
app.use(staticPlugin({ | |
prefix: '', | |
assets : "./dist", | |
})) | |
app.get('/', async () => { |
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 { fileURLToPath } from 'node:url' | |
import { defineConfig, devices } from '@playwright/test' | |
import type { ConfigOptions } from '@nuxt/test-utils/playwright' | |
// For first setup !! | |
// Please run 'npx playwright install' to install the browser | |
// Increase the timeout to 2 minutes (because Nuxt server is start so slow) | |
const timeout = 120000 | |
const hostUrl = 'http://0.0.0.0:3001' |
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
/*** | |
GitHub page: https://github.com/elad2412/the-new-css-reset | |
***/ | |
/* | |
Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property | |
- The "symbol *" part is to solve Firefox SVG sprite bug | |
- The "html" attribute is exclud, because otherwise a bug in Chrome breaks the CSS hyphens property (https://github.com/elad2412/the-new-css-reset/issues/36) | |
*/ | |
*:where( |
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 express = require('express') | |
const next = require('next') | |
const Cache = require('lru-cache'); | |
const compression = require('compression') | |
const port = parseInt(process.env.PORT, 10) || 3000 | |
const dev = process.env.NODE_ENV !== 'production' | |
const app = next({ dev }) |
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
// Google Play API Key | |
// ref: http://stackoverflow.com/questions/35127086/android-inapp-purchase-receipt-validation-google-play | |
// ref: https://developers.google.com/android-publisher/authorization | |
// ref: http://google.github.io/google-api-nodejs-client/18.0.0/index.html#toc14__anchor | |
// | |
// install npm package | |
// ref: https://github.com/google/google-api-nodejs-client | |
// $ npm install googleapis --save | |
// | |
const google = require('googleapis'); |
NewerOlder