Skip to content

Instantly share code, notes, and snippets.

View evandonovan's full-sized avatar

Evan Donovan evandonovan

View GitHub Profile
@evandonovan
evandonovan / themename_addressfield_formatter__components.php
Created January 10, 2019 03:54
Cleaner formatting for addressfield (plus RDFa microdata)
// Override addressfield_tokens themeing function
// Requires addressfield_tokens module as well as addressfield
// Add to template.php and change THEMENAME to name of your theme, then clear cache
function THEMENAME_addressfield_formatter__components($vars) {
$loc = $vars['address'];
$out = '';
// Note added RDFa microdata - https://schema.org/PostalAddress
// Organization name if present (nothing in first or last name fields)
@evandonovan
evandonovan / menu-include.js
Created May 21, 2019 01:47
Javascript to dynamically include content on an Unbounce page
/* Example code - by Evan Donovan, public domain
Adjust the paths and selectors below as needed.
*/
/**
* Get HTML from another URL -
* Uses the vanilla JS XMLHttpRequest
* https://gomakethings.com/ditching-jquery/#get-html-from-another-page
* The first parameter is a URL to fetch, the second is the JS function that is called to handle the data that is received.
* @param {String} url The URL
#!/bin/sh
# get entire website via wget
# from https://www.linuxjournal.com/content/downloading-entire-web-site-wget
# replace EXAMPLE.COM with your site
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
@evandonovan
evandonovan / character-counting-form.markdown
Last active April 11, 2024 19:38
Character Counting Form