This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
| import { spawn } from "node:child_process"; | |
| // Copies text to the Windows clipboard | |
| export function copyToClipboard(text: string) { | |
| spawn("clip").stdin.end(text); | |
| } |
| // Exposes a Web Component that is registered using: | |
| // customElements.define("x-example", ExampleElement) | |
| declare global { | |
| interface CustomElementRegistry { | |
| get(name: "x-example"): typeof ExampleElement | undefined; | |
| } | |
| } | |
| // No need to import the type or typecast the constructor anymore, | |
| // Intellisense recognizes its properties and methods |
| { | |
| // Config for emitting .d.ts files | |
| "$schema": "https://json.schemastore.org/tsconfig", | |
| "compilerOptions": { | |
| "target": "esnext", | |
| "module": "nodenext", | |
| "moduleDetection": "force", | |
| "newLine": "LF", | |
| "strict": true, | |
| "noFallthroughCasesInSwitch": true, |
| <?php | |
| function get_combinations($arrays) { | |
| $result = array(array()); | |
| foreach ($arrays as $property => $property_values) { | |
| $tmp = array(); | |
| foreach ($result as $result_item) { | |
| foreach ($property_values as $property_value) { | |
| $tmp[] = array_merge($result_item, array($property => $property_value)); | |
| } |
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - features/** | |
| - dependabot/** | |
| pull_request: | |
| branches: |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Example", | |
| "type": "node", | |
| "request": "launch", | |
| "runtimeExecutable": "node", | |
| "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], |
| import type { PluginOption } from "vite"; | |
| export function plugin(): PluginOption { | |
| return [ | |
| { | |
| apply: "serve", | |
| name: "example-serve", | |
| configureServer(server) { | |
| server.middlewares.use("/subfolder/example.txt", (_req, res) => { | |
| res.appendHeader("Content-Type", "text/plain"); |
| import type { PluginOption } from "vite"; | |
| import { format } from "prettier"; | |
| export function plugin(): PluginOption { | |
| return { | |
| name: "example", | |
| transformIndexHtml: async (html) => format(html, { | |
| // https://prettier.io/docs/en/options.html | |
| parser: "html", | |
| htmlWhitespaceSensitivity: "ignore" |
| import type { PluginOption } from "vite"; | |
| export function plugin(): PluginOption { | |
| return { | |
| name: "example", | |
| configureServer(server) { | |
| // Log all requests | |
| server.middlewares.use((req, _res, next) => { | |
| console.log(req.url); // full path | |
| next(); |