This code allows you to show a pop-up to print a "PDF" (rendered html) without first having to open the PDF viewer and requiring the user to press the print button.
You are an expert in Laravel, Inertia.js, React and Tailwind CSS, with a strong emphasis on Laravel and PHP best practices.Key Principles- Write concise, technical responses with accurate PHP examples.- Follow Laravel best practices and conventions.- Use object-oriented programming with a focus on SOLID principles.- Prefer iteration and modularization over duplication.- Use descriptive variable and method names.- Favor dependency injection and service containers.PHP and Laravel Core- Use PHP 8.3+ features when appropriate (e.g., typed properties, match expressions).- Follow PSR-12 coding standards.- Use strict typing: declare(strict_types=1);- Utilize Laravel's built-in features and helpers when possible.- Follow Laravel's directory structure and naming conventions.- Use lowercase with dashes for directories (e.g., app/Http/Controllers).- Implement proper error handling and logging: - Use Laravel's exception handling and logging features. - Create custom exceptions when necessary. - Use try-catch blocks for e |
#!/bin/bash | |
# Function to display usage information | |
usage() { | |
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
exit 1 | |
} | |
# Check if at least one argument (input file) is provided | |
if [ $# -lt 1 ]; then |
<?php | |
/* | |
* NOTES: | |
* | |
* - This was designed for my personal use and could be more robust. | |
* - Make sure to update the tables you want to import into. | |
* - Make sure to update the website url you want to import from. | |
* - Customize as needed. I had very few posts and no media. | |
* | |
*/ |
<?php | |
namespace App\Filament\PageTemplates; | |
use Filament\Forms\Components\Repeater; | |
use Filament\Forms\Components\RichEditor; | |
use Filament\Forms\Components\TextInput; | |
final class Faq | |
{ |
As of Statamic 3.4.8, Livewire works with Statamic's Half and Full Measure static caching without any additional configuration. This is due to the concept of replacers, which takes care of replacing Livewire's CSRF token.
There is a catch, though. On the first page load, Statamic will cache the first render of the Livewire component. This can be an issue with components that display dynamic content like entries in random order. In this example, the order won't be random on subsequent page loads, but will always show in the order that it was first cached in.
If your component simply shows the latest articles in descending order, and you clear the cache whenever an entry is saved, you don't have to worry about this, though.
This script command provides a quick way of searching the Laravel documentation.
It accepts a query and will open the first result in your default browser.
- Begin by creating a
~/.config/raycast/scripts
folder if you don't already have one.
By default Twill will disply the url of a module item to be {siteurl}/{module}/{slug}
e.g. mysite.com/pages/about. With the 'about' section being the editable slug. This is understandable as Twill knows nothing of your frontend routing. However it is likely confusing for editors, as that url presented will not be the final url of the content.
This will give us more correct urls e.g. mysite.com/about
// app/Http/Controllers/Admin/PageController
protected $permalinkBase = '';
Taken from StackExchange
Thanks to LangLangC
For temperature and other improvements see https://gist.github.com/cdleon/d16e7743e6f056fedbebc329333d79df
src
├── layouts
│ └── default.html
├── pages
│ └── index.html
├── data
│ └── i18n
│ ├── cn.json
│ └── template.html