Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Fitzer ryanfitzer

View GitHub Profile
@ryanfitzer
ryanfitzer / validate-html.js
Created Aug 21, 2019
HTML Validator Plugin for Webpack
View validate-html.js
/**
* 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;
View check-keys.js
/**
* 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 Sep 28, 2016
Word TOC XML Fragment
View fragment.xml
<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 Sep 11, 2016
Bookmarklet for Duck Duck Go to Google Search
View index.js
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)()
View git-merge-svn
#!/bin/bash
function usage {
echo "USAGE: git merge-svn <from> [<to>]"
echo ""
echo " from The branch name to be merged FROM"
echo " to Optional branch name to be merged onto. Default: HEAD"
echo ""
}
@ryanfitzer
ryanfitzer / Gruntfile.js
Last active Aug 30, 2016
An example of how to use [node-ssi](https://npmjs.org/package/ssi) in a custom Grunt task to inline all your apache includes.
View Gruntfile.js
module.exports = function( grunt ) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
buildPath: '../<%= pkg.name %>-build/',
clean: {
@ryanfitzer
ryanfitzer / Gruntfile.js
Last active Dec 18, 2015
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.
View Gruntfile.js
module.exports = function( grunt ) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
buildPath: '../<%= pkg.name %>-build/',
clean: {
options: {
@ryanfitzer
ryanfitzer / package.json
Last active Dec 18, 2015
Simple example project for using Volo to add libraries to a project. Use the "Download Gist" button to use as a readymade quickstart.
View package.json
{
"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 Dec 15, 2015
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.
View build.js
!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 Jan 23, 2012
Optimized `equalHeights()`
View jQuery.equalHeights.js
$.fn.equalHeights = function( px ) {
$( this ).each( function() {
var currentElement,
currentHeight,
currentTallest = 0,
children = $( this ).children();
children.each( function() {
You can’t perform that action at this time.