Skip to content

Instantly share code, notes, and snippets.

View chrispage1's full-sized avatar

Chris Page chrispage1

View GitHub Profile
@chrispage1
chrispage1 / Vite.php
Created July 16, 2023 17:04
Vite with WordPress
<?php
class Vite {
/**
* Flag to determine whether hot server is active.
* Calculated when Vite::initialise() is called.
*
* @var bool
*/
@chrispage1
chrispage1 / translate-files.php
Last active November 28, 2024 10:43
DeepL File Translation script
<?php
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Facades\Http;
define('LARAVEL_START', microtime(true));
// this project requires access to Laravel features
$path = '~/laravel-project-dir/';
@chrispage1
chrispage1 / convert.php
Last active December 12, 2025 14:36
PHP - FFMPEG Conversion Script
<?php
declare(strict_types=1);
// usage (arguments in square braces are required)
// php convert.php [filename.mp4] outputDir --noAudio --profiles=1080p,720p --segmentDuration=10
// load our CLI arguments
$inputFile = $argv[1] ?? null;
$outputDir = $argv[2] ?? 'output';
@chrispage1
chrispage1 / livewire_scan.py
Created January 8, 2026 15:14
An AI generated python script to scan servers for Livewire versions impacted by CVE-2025-54068
# Run this script as python3 ./livewire_scan.py
# This will find all composer.lock files and check for vulnerable versions
import os
import json
import re
# Vulnerability Definitions
# CVE-2025-54068 affects Livewire v3.0.0-beta.1 up to v3.6.3.
# Patched in v3.6.4.
@chrispage1
chrispage1 / ClientCredentialsRequest.php
Last active February 5, 2026 09:01
Example implementation of motomedialab/connector with oAuth Client Credentials grant
<?php
namespace App\Http\Integrations;
use Illuminate\Http\Client\Response;
use Motomedialab\Connector\BaseRequest;
use Motomedialab\Connector\Enums\RequestMethod;
use Motomedialab\Connector\Contracts\RequestInterface;
/**