Skip to content

Instantly share code, notes, and snippets.

View mcdwayne's full-sized avatar

Dwayne McDaniel mcdwayne

View GitHub Profile
____ __ ____ ______ .______ _______ ______ ___ .___ ___. .______
\ \ / \ / / / __ \ | _ \ | \ / | / \ | \/ | | _ \
\ \/ \/ / | | | | | |_) | | .--. || ,----' / ^ \ | \ / | | |_) |
\ / | | | | | / | | | || | / /_\ \ | |\/| | | ___/
\ /\ / | `--' | | |\ \----.| '--' || `----. / _____ \ | | | | | |
\__/ \__/ \______/ | _| `._____||_______/ \______|/__/ \__\ |__| |__| | _|
.___ ___. ______ .__ __. .___________..______ _______ ___ __
| \/ | / __ \ | \ | | | || _ \ | ____| / \ | |
| \ / | | | | | | \| | `---| |----`| |_) | | |__ / ^ \ | |
____ __ ____ ______ .______ _______ ______ ___ .___ ___. .______
\ \ / \ / / / __ \ | _ \ | \ / | / \ | \/ | | _ \
\ \/ \/ / | | | | | |_) | | .--. || ,----' / ^ \ | \ / | | |_) |
\ / | | | | | / | | | || | / /_\ \ | |\/| | | ___/
\ /\ / | `--' | | |\ \----.| '--' || `----. / _____ \ | | | | | |
\__/ \__/ \______/ | _| `._____||_______/ \______|/__/ \__\ |__| |__| | _|
_______. ___ ______ .______ ___ .___ ___. _______ .__ __. .___________. ______
/ | / \ / || _ \ / \ | \/ | | ____|| \ | | | | / __ \
| (----` / ^ \ | ,----'| |_) | / ^ \ | \ / | | |__ | \| | `---| |-
____ __ ____ ______ .______ _______ ______ ___ .___ ___. .______
\ \ / \ / / / __ \ | _ \ | \ / | / \ | \/ | | _ \
\ \/ \/ / | | | | | |_) | | .--. || ,----' / ^ \ | \ / | | |_) |
\ / | | | | | / | | | || | / /_\ \ | |\/| | | ___/
\ /\ / | `--' | | |\ \----.| '--' || `----. / _____ \ | | | | | |
\__/ \__/ \______/ | _| `._____||_______/ \______|/__/ \__\ |__| |__| | _|
_______. _______ ___ .___________..___________. __ _______
/ || ____| / \ | || || | | ____|
@mcdwayne
mcdwayne / Pantheon-WordPress-Nested-Docroot-Setup-Script.sh
Last active November 27, 2018 17:46
Pantheon-WordPress-Nested-Docroot-Setup-Script - just change out the DEMOSITENAME-CHANGE-ME variable and set the install credentials.
#!/bin/bash
# name the site
# DEMOSITENAME-CHANGE-ME
# make a site on Pantheon
terminus site:create -- DEMOSITENAME-CHANGE-ME DEMOSITENAME-CHANGE-ME WordPress
# install WP
terminus wp DEMOSITENAME-CHANGE-ME.dev -- core install --url=dev.DEMOSITENAME-CHANGE-ME.pantheonsite.io --title=TITLE --admin_user=USER --admin_password=Password(not password though) --admin_email=EMAIL
@mcdwayne
mcdwayne / listlistlist
Last active March 19, 2019 22:49
It is a real bash script that lists the plugins and themes, including if updates are available, for all sites in my maintenance org.
#!/bin/bash
SITES=$(terminus site:list --org=MYORG_UUID --field=name --format=string)
for i in $SITES
do
terminus wp $i.live -- plugin list
terminus wp $i.live -- theme list
done
@mcdwayne
mcdwayne / d9-drupal-check-all.sh
Last active March 25, 2019 06:07
Run the d9 compatibility checker against all D8 modules
#!/bin/bash
## Author: mcdwayne
## Created to support this project doc:
## https://docs.google.com/document/d/1UnVzmQhCv9_IT0-u-tjvWPDR-QQAU31ij2iKkio8U3U/edit#
##
## First, you gotta download the CSV of all the modules here
## https://docs.google.com/spreadsheets/d/1-W0k4vhdmw7ugzRdSa9orEc43_D5l6PPvUcrB8bw_-0/edit
## make sure it is named: modulelistmachinenames.csv
@mcdwayne
mcdwayne / Drupal-9-module-checker.sh
Last active March 25, 2019 12:26
a little script to ask you for a module name to install, check and give you hash in one step, per Joe Purcell's process: https://docs.google.com/document/d/1UnVzmQhCv9_IT0-u-tjvWPDR-QQAU31ij2iKkio8U3U
#!/bin/bash
## Author: mcdwayne
## Created to support this project doc:
## https://docs.google.com/document/d/1UnVzmQhCv9_IT0-u-tjvWPDR-QQAU31ij2iKkio8U3U/edit#
##
## Made at MidCamp 2019
# Ask for the module's machine name
# this is found in the module URL.
#!/bin/bash
## Point of script is to build a single giant git repo that has a branch per composer install of all modules, one branch per module. Such that devel is composer required only on the devel branch, and so forth. This is part of a larger strategy to easy distribute work with the intend ot only do weekly true ups of the publicly known plugins with committed updates.
## This also assumes you have a composer installed Drupal 8 repo.
## AND that you have a git repo present.
## See this doc for the former.
## https://docs.google.com/document/d/1UnVzmQhCv9_IT0-u-tjvWPDR-QQAU31ij2iKkio8U3U/edit#
# Code written by ChatGPT using input:
"""
write a python script that takes in json from the API at https://random.dog/woof.json, finds the picture url from the json, retrieves image from url and displays it as a http server locally
"""
# Everything below this line was the response
"""
Sure, here's a Python script that retrieves a random dog image from the JSON API provided by https://random.dog/woof.json, downloads the image to your local machine, and serves it locally on an HTTP server using the Flask web framework.
Before running the script, you will need to install the requests and Flask modules using pip.