Skip to content

Instantly share code, notes, and snippets.

View lucywoodman's full-sized avatar

lu lucywoodman

View GitHub Profile
@lucywoodman
lucywoodman / drop-legacy-multisite.sh
Created January 9, 2025 10:26
Remove legacy wordpress multisite
#!/bin/bash
cd /www/
# check for existing record
record_check=$( wp db query 'SELECT * FROM wp_sitemeta WHERE meta_key like "ms_files_rewriting";' )
if [[ $record_check == "" ]]; then
echo "Inserting record to disable ms-files.php"
wp db query 'INSERT INTO wp_sitemeta (meta_id, site_id, meta_key, meta_value) VALUES (NULL, "1", "ms_files_rewriting", "0");'
@lucywoodman
lucywoodman / googip.sh
Created January 9, 2025 10:20
Google Cloud IP ranges
#!/bin/bash
# https://support.google.com/a/answer/10026322?hl=en
curl -s https://www.gstatic.com/ipranges/cloud.json | jq '.prefixes[] | [.ipv4Prefix, .ipv6Prefix][] | select(. != null)' -r | sort -n
@lucywoodman
lucywoodman / talk-to-me-template.md
Created December 17, 2024 16:30 — forked from cassidoo/talk-to-me-template.md
A template for a "Talk to Me" page with your crew

Talk to Me page

Who am I?

...

What do I do at organization?

...

@lucywoodman
lucywoodman / env_scanner.py
Last active November 5, 2024 08:54
Env Scanner
import os
import re
from pathlib import Path
from collections import defaultdict
def scan_env_usage():
# Load current .env variables
env_vars = set()
if os.path.exists('.env'):
with open('.env', 'r') as f:
@lucywoodman
lucywoodman / Controllerlist.php
Last active September 11, 2023 14:06
CodeIgniter v3 list controllers/methods (i.e. auto routes)
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/***
* File: (Codeigniterapp)/libraries/Controllerlist.php
*
* A simple library to list all your controllers with their methods.
* This library will return an array with controllers and methods
*
* The library will scan the "controller" directory and (in case of) one (1) subdirectory level deep
@lucywoodman
lucywoodman / codeswing.json
Last active April 16, 2022 06:53
Jest testing with Simon
{
"scripts": [],
"styles": []
}
@lucywoodman
lucywoodman / codeswing.json
Last active April 4, 2022 07:19
Kids lunch generator
{
"scripts": [],
"styles": []
}
@lucywoodman
lucywoodman / codeswing.json
Last active April 3, 2022 16:48
Event listeners
{
"scripts": [],
"styles": []
}
@lucywoodman
lucywoodman / codeswing.json
Last active April 3, 2022 16:37
DOM - editing elements
{
"scripts": [],
"styles": []
}