Skip to content

Instantly share code, notes, and snippets.

View FLOATING-POINT's full-sized avatar

Brendan Oliver FLOATING-POINT

View GitHub Profile
@FLOATING-POINT
FLOATING-POINT / cursor.js
Last active October 27, 2025 21:25
Animated morphing cursor follower
;(function () {
let isResting = false
let isOverRestrictedEls = false
let lastMoveTime = performance.now()
const restDelayDefault = 5000 // ms before fading out
const restDelayPointerOver = 50 // ms before fading out
let restDelay = restDelayDefault // ms before fading out
let mouseX = 0
@FLOATING-POINT
FLOATING-POINT / Wordpress re-queue scripts
Created June 10, 2025 15:52
Wordpress re-queue scripts
function flp_move_scripts_to_footer(){
$scripts = [
[
'name' => 'wp-consent-api-js',
'file' => 'URL_TO_FILE',
'in_footer' => true,
'strategy' => 'defer',
'dependencies' => false, //false or []
'version' => null,
@FLOATING-POINT
FLOATING-POINT / FTP Deploy workflow
Created June 7, 2025 11:19
FTP Deploy workflow
on: push
name: 🚀 Deploy website on push
jobs:
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
@FLOATING-POINT
FLOATING-POINT / SSH Deploy workflow
Created June 7, 2025 11:18
SSH Deploy workflow
name: Github Action to Publish Wordpress Theme to hosting server
on:
push:
branches:
- main
jobs:
web-deploy:
name: 🚀 Deploy Wordpress Theme Every Commit to main
@FLOATING-POINT
FLOATING-POINT / SFTP Deploy workflow.txt
Last active June 7, 2025 11:17
SFTP Deploy workflow
on: [push]
jobs:
deploy_job:
runs-on: ubuntu-latest
name: Deploy with rsync exclude
steps:
- name: Checkout
uses: actions/checkout@v2
name: Github Action to Publish Wordpress Theme to hosting server
on:
push:
branches:
- main
jobs:
web-deploy:
@FLOATING-POINT
FLOATING-POINT / functions.php
Created May 29, 2025 12:27
Populate an ACF select field with all available menus
/**
* Create an ACF select field and populate options with menus created in appearance
*/
function namespace_populate_menus_field(array $field): array
{
// Reset all
$field['choices'] = [];
// Get all registered menus and add them to the select field
@FLOATING-POINT
FLOATING-POINT / index.css
Last active May 2, 2024 00:09
Number ani with IntersectionObserver API
.parent{
background-color:#444;
text-align:center;
height:200vh;
width:100vw;
position:relative;
font-family:system-ui;
font-size: 36px;
font-weight:bold;