package.json
:
{
"scripts": {
"dev": "vite",
"dev:server": "node public/build/server/server.js",
"build": "vite build",
"build:server": "vite build --outDir ./public/build/server --ssr ./resources/scripts/inertia/server.ts"
}
}
<template> | |
<section | |
:class="[ | |
'mb-16 mx-16', | |
'absolute inset-x-0 bottom-0 z-50', | |
'flex justify-center', | |
'transition-opacity duration-1000', | |
!hasFlashes && 'opacity-0', | |
]" | |
> |
#!/usr/bin/env bash | |
errors=false | |
screenshot_path=/tmp/screenshot.jpeg | |
default_client_id=c9a6efb3d7932fd | |
client_id="${IMGUR_CLIENT_ID:=$default_client_id}" | |
# Save as a file | |
xclip -se c -t image/jpeg -o > $screenshot_path 2>/dev/null |
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->notPath('bootstrap/cache') | |
->notPath('storage') | |
->notPath('vendor') | |
->in(__DIR__) | |
->name('*.php') | |
->notName('*.blade.php') | |
->ignoreDotFiles(true) |
const priority = ['mozilla.org']; | |
const blocklist = ['w3schools']; | |
const resultNode = document.getElementById('rso'); | |
// Sort results | |
const sorted = [...resultNode.children] | |
.filter((child) => { | |
const href = child.querySelectorAll('a')?.[0]?.href; | |
// If this code is transpiled by the TypeScript compiler, it will echo "You are using TypeScript" | |
// If this code is ran as-is, it will echo "You are using JavaScript" | |
console.log(new Set<String>('1') ? 'You are using TypeScript' : 'You are using JavaScript') | |
// This is actually valid JavaScript code: properly formatted, it looks like that: | |
// (new Set) < (String) > ('1') | |
// In TypeScript, the angle brackets after Set are interpreted as generic types, which is why the result is different. |
import { defineConfig, Plugin } from 'vite' | |
import vue from '@vitejs/plugin-vue' | |
// TODO: should be taken from environment | |
const certificates = { | |
key: 'D:\\Programmes\\Laragon\\etc\\ssl\\laragon.key', | |
crt: 'D:\\Programmes\\Laragon\\etc\\ssl\\laragon.crt', | |
} | |
export default defineConfig(({ command }) => ({ |
import path from 'path' | |
import vue from '@vitejs/plugin-vue' | |
import icons from 'vite-plugin-svg-icons' | |
import inspect from 'vite-plugin-inspect' | |
import tailwindcss from 'tailwindcss' | |
import autoprefixer from 'autoprefixer' | |
import createDebugger from 'debug' | |
import { defineConfig } from 'laravel-vite' | |
export default defineConfig() |
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\File; | |
use Illuminate\Support\Str; | |
/** | |
* Generates a JSON file with all translations. |
package.json
:
{
"scripts": {
"dev": "vite",
"dev:server": "node public/build/server/server.js",
"build": "vite build",
"build:server": "vite build --outDir ./public/build/server --ssr ./resources/scripts/inertia/server.ts"
}
}
import { Plugin } from 'vite' | |
const PLUGIN_NAME = 'vite:inertia:layout' | |
const TEMPLATE_LAYOUT_REGEX = /<template +layout(?: *= *['"](?:(?:(\w+):)?(\w+))['"] *)?>/ | |
export default (layouts: string = '@/views/layouts/'): Plugin => ({ | |
name: PLUGIN_NAME, | |
transform: (code: string) => { | |
if (!TEMPLATE_LAYOUT_REGEX.test(code)) { | |
return |