Skip to content

Instantly share code, notes, and snippets.

View WyattCast44's full-sized avatar
πŸ‘¨β€πŸš€
Space is the place πŸš€

Wyatt Castaneda WyattCast44

πŸ‘¨β€πŸš€
Space is the place πŸš€
View GitHub Profile

This gist was made for Laravel 5.7, although it should work for any version. It also assumes you have a Laravel site set up and configured on a basic level (you ran composer install, npm install, created an app key, etc).

  1. Run npm install stimulus

  2. Run npm install babel-plugin-transform-class-properties --save-dev

  3. Create .babelrc file in your project root, and paste in the following content:

{
@calebporzio
calebporzio / error_blade_directive.php
Created March 28, 2019 20:34
A little Blade directive to make working with validation errors a bit nicer.
<?php
// Usage:
// Before
@if ($errors->has('email'))
<span>{{ $errors->first('email') }}</span>
@endif
// After:
@loilo
loilo / manipulate_html.php
Last active November 28, 2024 08:01
Modify HTML Using PHP
<?php
function walk_dom(DOMNode $domNode, callable $callback): void
{
foreach ($domNode->childNodes as $node) {
$callback($node);
if ($node->hasChildNodes()) {
walk_dom($node, $callback);
}
@pesterhazy
pesterhazy / building-sync-systems.md
Last active May 2, 2025 15:05
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles