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
@pxlrbt
pxlrbt / PageTemplates_Faq.php
Last active August 1, 2024 14:49
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 September 4, 2024 05:08
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": {
<?php
/**
* Plugin Name: Gulp Sitemap Generator
* Plugin URI: https://gladdy.uk/blog/2014/04/13/using-uncss-and-grunt-uncss-with-wordpress/
* Description: Generate a JSON list of every page on a site so it can be used with Gulp and uncss.
* Author: Liam Gladdy
* Author URI: http://gladdy.co.uk
* Version: 1.0
*/
@natelandau
natelandau / .bash_profile
Last active August 24, 2024 14:09
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management