Skip to content

Instantly share code, notes, and snippets.

View tgeorgel's full-sized avatar

Thomas Georgel tgeorgel

  • BlueRock
  • France
View GitHub Profile
@bdmason
bdmason / using-sage-9-blade-templates-for-woocommerce.md
Last active October 26, 2022 10:48
Using Sage 9 blade templates for WooCommerce

Using Sage 9 blade templates for WooCommerce

Declare WooCommerce theme support

Open app/setup.php, find the after_setup_theme action and put add_theme_support('woocommerce'); inside the function.

Override the plugin templates

Add the templates you want to override in resources/woocommerce:

theme    
│
@robertdrakedennis
robertdrakedennis / editor.blade.php
Created December 16, 2021 05:14
Alpine tiptap editor + livewire
<div x-data="setupEditor(@entangle($attributes->wire('model')).defer)" x-init="() => init($refs.editor)" wire:ignore
{{ $attributes->whereDoesntStartWith('wire:model')->merge(['class' => 'editor !w-full !max-w-full']) }}>
<template x-if="editor">
<div class="flex space-x-4 items-center dark:text-neutral-100 fill-current py-2">
<button @click.prevent="Alpine.raw(editor).chain().toggleBold().focus().run()">
<x-icon-bold class="w-4 h-4" />
</button>
<button @click.prevent="Alpine.raw(editor).chain().toggleItalic().focus().run()">
<x-icon-italic class="w-4 h-4" />
</button>
@christiangenco
christiangenco / migrateHeroicons.js
Last active September 5, 2024 07:59 — forked from PicchiKevin/migrate.sh
Heroicons v1 to v2
const fs = require("fs");
if (!fs.existsSync("package.json")) {
console.error(
"Cannot find package.json. Please run this script in your project directory."
);
process.exit(1);
}
const package = fs.readFileSync("package.json", "utf8");
<?php
function memoize($target) {
static $memo = new WeakMap;
return new class ($target, $memo) {
function __construct(
protected $target,
protected &$memo,
) {}
<?php
namespace App\Livewire\Attributes;
use Attribute;
use Livewire\Features\SupportAttributes\Attribute as LivewireAttribute;
use function Livewire\store;
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]