Skip to content

Instantly share code, notes, and snippets.

View ccharlton's full-sized avatar
🎯
Focusing

Chris Charlton ccharlton

🎯
Focusing
View GitHub Profile
@ccharlton
ccharlton / cachetag_inject.info.yml
Created July 10, 2024 17:21
CacheTag Inject module for Drupal
name: 'CacheTag Inject'
type: module
description: 'Allows developers to edit an array of Node IDs or URI paths to assign specific CacheTags.'
core_version_requirement: ^10
package: Custom
dependencies:
- drupal:node
@ccharlton
ccharlton / newrelic-nrql-labeled-http-status-codes
Created June 14, 2024 20:51
New Relic (NRQL) query with labeled HTTP Status Codes
SELECT count(http.statusCode)
FROM Transaction
WHERE appName = {{appName}}
FACET CASES(
WHERE http.statusCode = 100 AS '100 Continue',
WHERE http.statusCode = 101 AS '101 Switching Protocols',
WHERE http.statusCode = 102 AS '102 Processing',
WHERE http.statusCode = 103 AS '103 Early Hints',
WHERE http.statusCode >= 104 AND http.statusCode <= 199 AS '104-199 Unassigned',
WHERE http.statusCode = 200 AS '200 OK',
@ccharlton
ccharlton / github-actions-workflows-get-secrets.sh
Created February 22, 2024 05:13
Extract variables & secrets from CI/CD workflow folders
#!/bin/sh
# Lists all workflows folder secrets in a simple list
echo ""
echo "List all secrets/variables in one simple list...\n"
grep -oh '\${{ secrets\.[^}]*}}' *.yml | sed 's/\${{ secrets\.\([^}]*\)}}/\1/' | sort | uniq
# Extract 'name' from each YML file
echo "\n--------------------\n"
echo "What does each file do?\n"
@ccharlton
ccharlton / Text Substitutions Additions.plist
Created April 11, 2022 04:00
MacOS Keyboard Test Substitution Additions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>first.last@example.com</string>
<key>shortcut</key>
<string>;email</string>
</dict>
@ccharlton
ccharlton / quicksilver.yml
Last active February 25, 2024 05:56
Pantheon Quicksilver profiles pack
#
# Quicksilver configuration file
#
# Requirements:
# - Terminus Quicksilver plugin: https://github.com/pantheon-systems/terminus-quicksilver-plugin)
#
# Copy to $HOME/.quicksilver/quicksilver.yml
#
# To create your own repository with installable examples:
#
@ccharlton
ccharlton / cloudflare_firewall_bulk_ip_whitelist.sh
Created August 4, 2018 20:39
Cloudflare firewall bulk IP whitelist
#!/bin/bash
IPADDRESS=("123.123.123.124" "456.456.456.457" "890.890.890.891")
echo "Adding IP addresses to Cloudflare Firewall..."
echo ''
for i in "${IPADDRESS[@]}"
do
:
# do whatever on $i
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>