Skip to content

Instantly share code, notes, and snippets.

View sjardim's full-sized avatar
🏠
Working from home

Sérgio Jardim sjardim

🏠
Working from home
View GitHub Profile
@lucacastelnuovo
lucacastelnuovo / Filament V3 - Print Pop-Up.md
Last active October 18, 2024 11:16
Filament V3 - Print Pop-Up

Filament V3 - Print Pop-Up

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.

@chrispian
chrispian / getPosts.php
Last active September 27, 2024 18:34
Import WordPress posts, categories, and tags to a Laravel table
<?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.
*
*/
@pxlrbt
pxlrbt / PageTemplates_Faq.php
Last active November 29, 2024 10:13
Filament Template
<?php
namespace App\Filament\PageTemplates;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\TextInput;
final class Faq
{
@aerni
aerni / LivewireWithStatamicStaticCaching.md
Last active September 4, 2024 18:11
Learn how to use Livewire together with Statamic's static caching

How to use Livewire with Statamic static caching

Since Statamic 3.4.8

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.

Caveats

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.

@ryangjchandler
ryangjchandler / README.md
Last active June 23, 2023 08:22
Raycast - Laravel Documentation

Raycast - Laravel Documentation

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.

Installation

  1. Begin by creating a ~/.config/raycast/scripts folder if you don't already have one.
@chrispymm
chrispymm / twill-nested-module-urls.md
Created June 10, 2020 07:26
[Support nested urls for nested modules] #twill

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.

Remove module name form url

This will give us more correct urls e.g. mysite.com/about

// app/Http/Controllers/Admin/PageController

	protected $permalinkBase = '';
src
├── layouts
│   └── default.html
├── pages
│   └── index.html
├── data
│   └── i18n
│       ├── cn.json
│ └── template.html
@mbejda
mbejda / Industries.csv
Last active November 27, 2024 17:04
Compiled list of industries.
Industry
Accounting
Airlines/Aviation
Alternative Dispute Resolution
Alternative Medicine
Animation
Apparel/Fashion
Architecture/Planning
Arts/Crafts
Automotive
@mfurlend
mfurlend / composer.json
Last active September 11, 2024 13:35
composer require git repository
{
"name": "my_vendor_name/my_package",
"description": "My Package Description",
"license": "GPL-3.0",
"autoload": {
"classmap": [ // search these directories for classes
"lib/"
]
},
"repositories": {