Skip to content

Instantly share code, notes, and snippets.

@ciamarro
ciamarro / livewire-directive.md
Created March 18, 2020 13:15
@livewire directive for phpstorm
  1. File > Settings > Languages & Frameworks > PHP > Blade
  2. Uncheck use default settings
  3. Directives > +
  4. Name livewire
  5. Prefix <?php '', [
  6. Suffix ])?&gt;
@ciamarro
ciamarro / Kernel.php
Last active April 14, 2022 16:47
Maintain localization / locale when using Laravel Livewire
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
//----
@ciamarro
ciamarro / random_radio.js
Created July 7, 2017 13:07
Randomly select all radio buttons on a form
var a = document.querySelectorAll('input[type=radio]');
for (var i=0; i<a.length; i++)
// from https://stackoverflow.com/a/18066088/8148848
a[i].checked = ( (Math.random()*10) > 5) ? true : false;
@ciamarro
ciamarro / CKeditor Toolbar Items
Created February 23, 2015 16:54
CKEditor: List of toolbar items
//http://ckeditor.com/comment/123266#comment-123266
items
"Source"
"Save"
"NewPage"
"DocProps"
"Preview"
"Print"
"Templates"
"document"