Skip to content

Instantly share code, notes, and snippets.

@owenconti
owenconti / 5ec33c88579e3.html
Created May 19, 2020 01:55
Using CSS transitions with TailwindCSS v1.2
<button class="opacity-50 hover:opacity-100 transition-opacity duration-1000 ease-out">...</button>
@owenconti
owenconti / 5ec33c000dde9.sh
Last active May 19, 2020 03:12
Setting up dynamic HTTP redirects with Statamic v3
'/some-old-slug' => '/new-slug'
@owenconti
owenconti / 5ec33a8720baf.yaml
Created May 19, 2020 01:46
Escaping Antlers output in Statamic via the `noparse` tag
-
type: code_block
content:
-
type: text
text: '{{ redirect to="{{ redirect_url }}" }}'
@owenconti
owenconti / 5ec33a70d92c4.yaml
Created May 19, 2020 01:46
Escaping Antlers output in Statamic via the `noparse` tag
-
type: code_block
content:
-
type: text
text: '{{ redirect to="{{ redirect_url }}" }}'
@owenconti
owenconti / 5ec339ed59c37.html
Created May 19, 2020 01:44
Moving our search drop down from Algolia to Alpine.js
<div class="relative">
<div id="#search-box"></div>
<div id="#hits"></div>
</div>
@owenconti
owenconti / 5ec33993deabd.jsx
Created May 19, 2020 01:42
React error boundaries
function SomeComponent() {
return (
<CustomErrorCatcher>
{invalidVariable}
</CustomerErrorCatcher>
);
}
@owenconti
owenconti / 5ec3395c86134.php
Created May 19, 2020 01:41
Building a search drop down component with Laravel Livewire
<?php
namespace App\Http\Livewire;
use App\Contact;
use Livewire\Component;
class ContactSearchBar extends Component
{
public $query;
@owenconti
owenconti / 5ec339214879d.sh
Created May 19, 2020 01:40
Laravel Dusk Error: "Chrome version must be between 70 and 73"
php artisan dusk:chrome-driver
@owenconti
owenconti / 5ec338e89a95d.xml
Created May 19, 2020 01:39
Setting up PHP CodeSniffer for a Laravel Application
<?xml version="1.0"?>
<ruleset name="Standard">
<rule ref="PSR2">
<exclude name="PSR1.Methods.CamelCapsMethodName"/>
</rule>
</ruleset>
@owenconti
owenconti / 5ec338bf6a242.jsx
Created May 19, 2020 01:39
How to fix "cannot update unmounted component" warning with React hooks
React.useEffect(() => {
let unmounted = false;
setTimeout(() => {
if (!unmounted) {
// update state here...
}
}, 3000);
return () => {
unmounted = true;