Skip to content

Instantly share code, notes, and snippets.

🚨
GitHub Drop ICE

Zach Leatherman zachleat

🚨
GitHub Drop ICE
View GitHub Profile
@zachleat
zachleat / jquery.scrolly.js
Created Apr 5, 2011
jQuery scrolly special event
View jquery.scrolly.js
/*
* Changes by Zach Leatherman (@zachleat)
* from James Padolsey Special Scroll Events
* http://james.padolsey.com/javascript/special-scroll-events-for-jquery/
* -------------------------------------------------------
* Dual licensed under the MIT and GPL licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/copyleft/gpl.html
*/
@zachleat
zachleat / gist:980895
Created May 19, 2011
HTML5 Boilerplate Issue #378 (No Compatibility View button, tested in IE7/IE8/IE9)
View gist:980895
<!--[if IE ]><![endif]-->
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@zachleat
zachleat / gist:2008932
Created Mar 9, 2012
Prevent zoom on focus
View gist:2008932
// * iOS zooms on form element focus. This script prevents that behavior.
// * <meta name="viewport" content="width=device-width,initial-scale=1">
// If you dynamically add a maximum-scale where no default exists,
// the value persists on the page even after removed from viewport.content.
// So if no maximum-scale is set, adds maximum-scale=10 on blur.
// If maximum-scale is set, reuses that original value.
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0">
// second maximum-scale declaration will take precedence.
// * Will respect original maximum-scale, if set.
// * Works with int or float scale values.
@zachleat
zachleat / gist:4695349
Last active Dec 12, 2015
Talk abstract for Nebraska Code Camp 2013: Tool or Die (A Web Developer's Workflow)
View gist:4695349
“Tool and die makers are a class of machinists who work primarily in
toolroom environments—…often in an environment with flexible, semipermeable
boundaries from production work.”
These are the people that make the tools to make the products. This was the
environment I grew up in—watching my father work as a tool and die maker.
He could make anything! But more importantly, he knew the value of good
tools—even if you had to construct them yourself.
Tools are important and tooling for Web Development is improving! I'll go
@zachleat
zachleat / jquery.postmessage.js
Created Apr 10, 2013
postMessage polyfill for IE < 8 that uses window.name and queues messages so they aren't lost while polling. Requires a JSON.parse polyfill (like JSON.js).
View jquery.postmessage.js
/*!
* jQuery postMessage - v1.0 - 8/26/2011
*
* Copyright (c) 2011 "zachleat" Zach Leatherman
* Copyright (c) 2009 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://jquery.org/license
*/
/* Forked from http://benalman.com/projects/jquery-postmessage-plugin/
@zachleat
zachleat / gist:5405752
Created Apr 17, 2013
Modernizr/modernizr.com Issue #31
View gist:5405752
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
*/
;
window.Modernizr = (function( window, document, undefined ) {
var version = '2.6.2',
@zachleat
zachleat / gist:5407068
Last active Dec 16, 2015
Differences between Pure Internet Explorers and IE Compatibility Modes
View gist:5407068

Or, yet more evidence that you should use feature detection instead of browser/user agent sniffing.

IE9

Not supported in IE9 but works in IE10-as-IE9

  • Unprefixed CSS transform. Should require -ms-transform but doesn’t require it.

IE8

@zachleat
zachleat / reading_time.rb
Last active Nov 5, 2019
Read this in X minutes Liquid Filter Plugin (for Jekyll)
View reading_time.rb
# Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@zachleat
zachleat / gist:6114627
Created Jul 30, 2013
position: sticky Notes
View gist:6114627

Supported (does not work on table headers):

  • Chrome Canary 30 (behind about:flags “experimental Web Platform features”)
  • Chrome 28 (behind about:flags “experimental WebKit features”)

Supported (works on table headers):

  • iOS 6.1

Not Supported:

  • iOS 5.1
  • Firefox 22 (Mac)
You can’t perform that action at this time.