Skip to content

Instantly share code, notes, and snippets.

View raymadrona's full-sized avatar

Ray Anthony Madrona raymadrona

View GitHub Profile
@newtonjob
newtonjob / form.js
Created February 2, 2026 08:12
Form plugin for Alpine.js
document.addEventListener('alpine:init', () => {
Alpine.magic('form', el => () => {
return Alpine.reactive({
processing: false,
recentlySuccessful: false,
errors: {},
submit() {
return axios.post(el.action, el).then(response => {
this.errors = {};
this.recentlySuccessful = true;
@driesvints
driesvints / gist:70162727698210274c3982ad87b37ed5
Last active February 13, 2026 20:13
Cloudflare PDF generation in Laravel.
// Controller method...
public function download()
{
return response()->streamDownload(function () {
$token = config('services.cloudflare.api_token');
$accountId = config('services.cloudflare.account_id');
$cloudflareApi = 'https://api.cloudflare.com/client/v4';
echo Http::withToken($token)
->post($cloudflareApi.'/accounts/'.$accountId.'/browser-rendering/pdf', [
@dabit3
dabit3 / setup.md
Last active February 14, 2026 12:30
How to set up OpenClaw on Digital Ocean

OpenClaw on DigitalOcean

1. Create a Droplet

Ubuntu 24.04 LTS, nearest region

2. Select Premium AMD

2 GB RAM / 1 AMD CPU / 50 GB NVMe

3. SSH into server

Alpine.directive('typed', (el, { expression, modifiers }, { evaluateLater, effect, cleanup }) => {
const getStrings = evaluateLater(expression);
const modifierValue = (key, fallback) => {
if (-1 === modifiers.indexOf(key)) {
return fallback;
}
const value = modifiers[modifiers.indexOf(key) + 1];
@jonneroelofs
jonneroelofs / SignatureExample.php
Created January 10, 2022 18:44
Wrapping SignaturePad and storing base-64 with Alpine.js and Laravel Livewire
<?php
namespace App\Http\Livewire;
use Illuminate\Support\Str;
use Livewire\Component;
class SignatureExample extends Component
{
public $signature;
@PhiloNL
PhiloNL / .env
Last active August 7, 2024 20:19
Simple, fast, and resilient open-source WebSockets server using Soketi with SSL in less than 5 minutes
PUSHER_HOST=socket.yourdomain.com
PUSHER_APP_ID=unlock
PUSHER_APP_KEY=123
PUSHER_APP_SECRET=456
PUSHER_PORT=443
PUSHER_SCHEME=https
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active October 4, 2025 08:06
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
@osbre
osbre / AppServiceProvider.php
Created September 7, 2019 16:08
Laravel notifications - how to use custom type
<?php
namespace App\Providers;
use App\Notifications\DatabaseChannel as CustomDatabaseChannel;
use Illuminate\Notifications\Channels\DatabaseChannel;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
@messi89
messi89 / \Laravel\Passport\Http\Controllers\AccessTokenController
Last active October 25, 2025 21:00
Laravel Passport - Customize The Token Response
<?php
/**
* Laravel Passport - Customize Token response.
*
* @author Messi89 OVERGEN <@messi89minou>
* @link https://github.com/messi89
*/
namespace App\Http\Controllers\Api;
use App\Models\User;
@chunter
chunter / pageant-autoload-keys-at-startup.txt
Created June 20, 2017 10:51
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.