Skip to content

Instantly share code, notes, and snippets.

@apsonex
apsonex / cache.js
Created March 1, 2026 14:12
Tiny JavaScript Cache with Expiration + remember() Pattern
import { isFunction } from "lodash-es";
class Cache {
constructor(driver = 'local') {
this.driver = driver;
this.storage = driver === 'local' ? window.localStorage : null;
}
static local() {
return new Cache('local');
<?php
namespace App\Support\Debug;
use App\Concerns\Makeable;
class AppDebug
{
use Makeable;
{
"slate": {
"label": "Slate",
"order": 1,
"colors": {
"50": {
"hex": "#f8fafc",
"rgb": "rgb(248, 250, 252)"
},
"100": {
@apsonex
apsonex / recaptcha.blade.php
Created May 8, 2023 16:01 — forked from JeffreyWay/recaptcha.blade.php
Recaptcha Example using Laravel, Blade Components, and Alpine
<div
x-data="recaptcha()"
x-init="init"
@recaptcha.window="execute"
></div>
@push('scripts')
<script src="https://www.google.com/recaptcha/api.js?render=explicit"></script>
<script>
@apsonex
apsonex / ImageMaliciousDetectionRule.php
Created March 4, 2021 18:33 — forked from afiqiqmal/ImageMaliciousDetectionRule.php
Simple Laravel Validation Rule for Image Content Validation.
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class ImageMaliciousDetectionRule implements Rule
{
protected $malicious_keywords = [