Skip to content

Instantly share code, notes, and snippets.

View heychris's full-sized avatar

Chris Wilson heychris

View GitHub Profile
module.exports = function(grunt) {
"use strict";
// -------------------------------------------------------------------------
// #### Load plugins as needed ####
// Using a 'just in time' approach -- meaning: only load plugins when they
// are needed -- this will automatically find, then load, any and all
// plugins that are needed by the task currently being executed. It will
// scan the devDependencies object, in package.json, and match any of the
@heychris
heychris / updatenav.js
Created March 3, 2014 21:48
Pure javascript way to update the nav
// Pure javascript
// nuttin else
// On Scroll do this thing
window.onscroll = function () {
"use strict";
// Set up the cool variables
var scrollPos = document.documentElement.scrollTop + document.body.scrollTop,
@heychris
heychris / Find Scroll Direction
Created February 10, 2014 16:39
Javascript vs jQuery find scroll direction
// Pure Javascript way of finding scroll direction
// Tested better than jQuery alternative
// http://jsperf.com/javascript-vs-jquery-find-scroll-direction
var scrollTop = (window.pageYOffset !==
undefined) ? window.pageYOffset : (
document.documentElement ||
document.body.parentNode ||
document.body).scrollTop,
position = document.body.scrollTop;
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@heychris
heychris / CSS: Contents
Created January 28, 2013 17:21
CSS: Contents
/*------------------------------------*\
$CONTENTS
\*------------------------------------*/
/**
* CONTENTS............You’re reading it!
* RESET...............Set our reset defaults
* FONT-FACE...........Import brand font files
* ELEMENTS............Unclassed elements (h1, ul, etc.)
* COMPONENTS..........Full components constructed from objects and their extensions
* STYLE TRUMPS........Error states, etc.
@heychris
heychris / HTML: Startup
Last active December 11, 2015 20:39
HTML: Startup
<!doctype html>
<html>
<head>
<meta charset=UTF-8>
<meta name=viewport content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<title></title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
@heychris
heychris / CSS: Image Replacement
Created January 28, 2013 16:19
CSS: Image Replacement
.ir {
background-color: transparent;
border: 0;
overflow: hidden;
/* IE 6/7 fallback */
*text-indent: -9999px;
}
.ir:before {
content: "";