Skip to content

Instantly share code, notes, and snippets.

@jpolete
jpolete / functions.php
Last active January 4, 2016 04:28
A simple (albeit limited) setup for caching static assets in WordPress. Sets far future http headers and then writes urls with timestamps. Full explanation at http://blog.poleteweb.com/2013/09/26/performance-tuning-wordpress-far-future-headers-and-cache-busting/
function cache_buster_url($uri) {
//Get base url of WP installation
$base_url = get_bloginfo('url');
//Get local path to the root of the WP installation
$installation_root = $_SERVER['DOCUMENT_ROOT'];
//Get path (from root) to file
$path_info = str_replace($base_url, '', $uri);
@jpolete
jpolete / snippets.json
Last active June 23, 2023 21:38
Emmet abbreviations and snippets for a page skeleton with WAI-ARIA landmark roles and a default meta viewport declaration. For Sublime Text Mac users, save this file in ~/emmet. For other editors/OSes find your default location for emmet overrides.
{
"html": {
"snippets": {
"page": "<header role=\"banner\">\n\t<nav role=\"navigation\">\n\t\t${1}\n\t</nav>\n</header>\n<div role=\"main\">\n\t${2}\n</div>\n<footer role=\"contentinfo\">\n\t${3}\n</footer>",
"meta:vpm": "<meta name=\"viewport\" content=\"initial-scale=1.0, width=device-width\" />"
},
"abbreviations": {
"doc": "html>(head>meta[charset=UTF-8]+meta:vpm+title{${1:Document}})+body",
"!:page": "html:5>page"
}