Skip to content

Instantly share code, notes, and snippets.

View Firestorm980's full-sized avatar

Jon Christensen Firestorm980

View GitHub Profile
@Firestorm980
Firestorm980 / jquery.orphans.js
Last active October 5, 2015 21:41
jQuery Fix Orphans
/**
* This script is modified from Ricardo Zea: http://codepen.io/ricardozea/pen/qcDCJ
* His was a modified script from CSS-Tricks: https://css-tricks.com/preventing-widows-in-post-titles/
* It should be able to modify the last word of the selector and make it so there is no orphan when there is no room using the   trick.
* May adapt it into a plugin.
*/
jQuery(document).ready(function($) {
$('p').each(function() {
var wordArrayRaw = $(this).html().split(' '); // Get an array of words
var wordArray = wordArrayRaw.filter(function(n){ return (n !== undefined && n !== ''); }); // Filter out the bad
@Firestorm980
Firestorm980 / custom_wp_scripts_styles.php
Created September 17, 2015 16:24
WordPress cache busting
/*
The trick to this whole thing is the cache busting "filemtime()" function.
It takes the file creation time and makes that the version number.
So, we don't have to keep track of versions and it will always be unique.
*/
// You don't have to define this stuff, but it can be useful for later since we reference them so much.
define( 'THEME_DIR_URI', get_template_directory_uri() );
define( 'THEME_DIR', get_template_directory() );
@Firestorm980
Firestorm980 / html-test-markup.html
Last active August 13, 2021 14:53
HTML Test Markup
<div id="top" class="page" role="document">
<header role="banner">
<h1>HTML5 Test Page</h1>
This is a test page filled with common HTML elements to be used to provide visual feedback whilst building CSS systems and frameworks.
</header>
<nav role="navigation">
<ul>
<li><a href="#text">Text</a>
<ul>