Skip to content

Instantly share code, notes, and snippets.

Joe Maller joemaller

Block or report user

Report or block joemaller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joemaller
joemaller / wordpress-archives.md
Last active May 27, 2019
WordPress Archives: Here we go again
View wordpress-archives.md

WordPress Archives: Here we go again

We've been here before. A WordPress site needs to list a collection of things. Native WordPress archives seem like a good idea. But then they're not.

Beyond the most basic use, WordPress archives tend to fail in a number of ways.

For page-dominant sites, archives are unintuitive, they just appear magically -- or don't. None of the expected authoring tools are available and archive endpoints don't show as a default choice when building menus.

There's no clean way to author content on archive landing pages. Embedding content into template files is too rigid and contrary to the entire point of a CMS. Pulling custom values from a separate ACF options page requires extra documentation (which no one reads), is easily forgettable and is a mess conceptually.

@joemaller
joemaller / .gitignore
Last active May 14, 2019
Pagination Test
View .gitignore
node_modules/
package-lock.json
@joemaller
joemaller / svg-animate.js
Last active Apr 15, 2019
Vanilla JS SVG line animation helper, works in IE
View svg-animate.js
/**
* Initialize animation on an SVG path or set of paths, this returns a controller
* object
*
* var lines = animate({
* parent: "#someElement",
* selector: ".theActualLines",
* duration: 2500
* })
*
@joemaller
joemaller / banner.js
Created Apr 1, 2019
dumb little reporting helper
View banner.js
const banner = (str = "", len = 100, pad = "-") => {
if (str.length > len) return str;
const out = new Array(len);
out.splice(Math.floor((len - str.length - 1) / 2), 0, ` ${str} `);
return `\n${out.join(pad).substring(0, len)}`;
};
@joemaller
joemaller / .htaccess
Created Mar 14, 2019
A very simple htaccess file for redirecting traffic from http to https (insecure to secure)
View .htaccess
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
ErrorDocument 404 /404.html
ErrorDocument 401 "Unauthorized Access"
@joemaller
joemaller / redirect.html
Last active Mar 8, 2019
A basic redirect page with fallbacks: Meta refresh tag, JavaScript window.location and a bare link
View redirect.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="0;url=SITE_ADDRESS" />
<title>SITE_NAME Redirect</title>
@joemaller
joemaller / markdown-reference.md
Created Nov 30, 2018
An example of what's possible to do with Markdown.
View markdown-reference.md

Markdown Reference Sample

An example of what's possible to do with Markdown.

Basic formatting

Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no reason it should become anything else.

Paragraphs must be separated by a blank line. Basic formatting of italics and bold is supported. This can be nested like so.

@joemaller
joemaller / functions.php
Created Oct 1, 2018
flush WordPress rewrite rules on every page load
View functions.php
<?php
/**
* Expensive, but helpful if permalink structures are changing freuqently
* Don't do this on a production site.
*/
add_action('init', 'flush_rewrite_rules');
@joemaller
joemaller / README.md
Last active Sep 26, 2018
A quick image compression gulp workflow using https://pngquant.org/
View README.md

Gulp pngquant Workflow

A quick image compression gulp workflow using pngquant.

Instructions

  1. Run npm install
  2. Creatae a ./src dir and put some images in it
  3. npm run build to compress, npm run start to compress and watch ./src for new files
@joemaller
joemaller / Verizon FiOS - DNS servers.md
Created May 9, 2018
Nameservers for Verizon FiOS - North East US specific
View Verizon FiOS - DNS servers.md

Boston, MA:

  • nsbost02.verizon.net - 71.243.0.14

New York, NY:

  • nsnyny02.verizon.net - 68.237.161.14

Newark, NJ:

nsnwrk02.verizon.net - 71.250.0.14

Philadelphia, PA:

You can’t perform that action at this time.