Skip to content

Instantly share code, notes, and snippets.

View ryanfitzer's full-sized avatar

Ryan Fitzer ryanfitzer

View GitHub Profile
@ryanfitzer
ryanfitzer / validate-html.js
Created August 21, 2019 18:19
HTML Validator Plugin for Webpack
/**
* HTML Validator Plugin for Webpack
*
* @docs https://html-validate.org
*/
const path = require( 'path' );
const columnify = require( 'columnify' );
const HtmlWebpackPlugin = require( 'html-webpack-plugin' );
const HtmlValidate = require( 'html-validate' ).HtmlValidate;
/**
* Check for common keyboard actions.
*
* @example
* checkInputType( e, 'shift click', fn );
* checkInputType( e, [ 'escape', 'enter' ], fn );
* checkInputType( e, [ 'tab', 'shift tab' ], fn );
*
* @param {Event} e - The event object.
* @param {String|Array} types - The name(s) of the inputs to check.
@ryanfitzer
ryanfitzer / fragment.xml
Created September 28, 2016 22:04
Word TOC XML Fragment
<w:p w14:paraId="72754A29" w14:textId="77777777" w:rsidR="00E76149" w:rsidRDefault="00E76149">
<w:pPr>
<w:pStyle w:val="TOC1"/>
<w:tabs>
<w:tab w:val="right" w:leader="dot" w:pos="9350"/>
</w:tabs>
<w:rPr>
<w:rFonts w:eastAsiaTheme="minorEastAsia"/>
<w:noProof/>
</w:rPr>
@ryanfitzer
ryanfitzer / index.js
Created September 11, 2016 00:25
Bookmarklet for Duck Duck Go to Google Search
javascript:(function()%7Bwindow.location.assign('https%3A%2F%2Fwww.google.com%2Fsearch%3F'%2B%2Fq%5B%5E%26%5D%2B%2F.exec(window.location.search))%7D)()
@ryanfitzer
ryanfitzer / Gruntfile.js
Last active August 30, 2016 15:34
An example of how to use [node-ssi](https://npmjs.org/package/ssi) in a custom Grunt task to inline all your apache includes.
module.exports = function( grunt ) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
buildPath: '../<%= pkg.name %>-build/',
clean: {
@ryanfitzer
ryanfitzer / Gruntfile.js
Last active December 18, 2015 16:28
Simple example project for using the grunt-preprocess task to easily build files based on custom variables. Use the "Download Gist" button to use as a readymade quickstart.
module.exports = function( grunt ) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
buildPath: '../<%= pkg.name %>-build/',
clean: {
options: {
@ryanfitzer
ryanfitzer / package.json
Last active December 18, 2015 16:19
Simple example project for using Volo to add libraries to a project. Use the "Download Gist" button to use as a readymade quickstart.
{
"name": "Volo-Example",
"version": "0.0.1",
"description": "Kick the tires.",
"author": "Me",
"volo": {
"baseUrl": "library/js",
"dependencies": {
"jquery": "github:jquery/jquery/2.0.2",
"Modernizr": "github:Modernizr/Modernizr/v2.6.2"
@ryanfitzer
ryanfitzer / build.js
Last active December 15, 2015 04:29
CSSCat does not copy the files into a new directory before processing. The following snippet shows how to use use CSSCat's fs-helper.js in your build.js file to create a copy of the original directory.
!function() {
var path = require( 'path' )
, csscat = require( 'csscat' )
, fsh = require( 'csscat/lib/fsh' )
;
// The directory to copy (relative to this file)
var original = './';
@ryanfitzer
ryanfitzer / jQuery.equalHeights.js
Created January 23, 2012 02:16
Optimized `equalHeights()`
$.fn.equalHeights = function( px ) {
$( this ).each( function() {
var currentElement,
currentHeight,
currentTallest = 0,
children = $( this ).children();
children.each( function() {
@ryanfitzer
ryanfitzer / gist:1372424
Created November 17, 2011 05:18 — forked from jrburke/basic.js
possible jquery plugin boilerplate
!function( root, factory ) {
// Export
if ( typeof exports === 'object' ) {
// Node/CommonJS
factory( require( 'jquery' ) );
} else if ( typeof define === 'function' && define.amd ) {