Skip to content

Instantly share code, notes, and snippets.


Zander Martineau mrmartineau

View GitHub Profile
View formsuitest.js
testSupport: function(){
var frowny = ":("; //no support frowny!
var inputs = $('input');
var $this = $(this);
View media query check
* mediaquery function - test whether a CSS media type or query applies
* author: Scott Jehl
* Copyright (c) 2010 Filament Group, Inc
* MIT license
* Developed as a feature of the EnhanceJS Framework (
* thx to:
- for inner css text trick
- @paul_irish for fakeBody trick
View media query check - media.matchMedium.js
* media.matchMedium()- test whether a CSS media type or media query applies
* primary author: Scott Jehl
* Copyright (c) 2010 Filament Group, Inc
* MIT license
* adapted by Paul Irish to use the matchMedium API
* Doesn't implement media.type as there's no way for crossbrowser property
* getters. instead of media.type == 'tv' just use media.matchMedium('tv')
ralphholzmann / iframe-facebook.js
Created Nov 13, 2010
Modernizr tests to detect if you're in an iframe or facebook iframe
View iframe-facebook.js
.addTest('iframe', function() {
return != window.location;
.addTest('facebook', function() {
return !! ~ location.href.indexOf( 'fb_sig_in_iframe=1' );
redoPop / jquery.loadshiv.js
Created Dec 10, 2010
Replacement jQuery.load() for use with innerShiv
View jquery.loadshiv.js
// jQuery plugin based on .load() for use with innerShiv
// for more info
// $('selector').loadShiv('example.html selector');
jQuery.fn.loadShiv = function (url, params, callback) {
var off, selector, self, type;
if (!this.length || typeof url !== 'string') {
return this;
View cat.js
var cat = {};
* cat.NewsBox
* Retrieves news from Google
cat.NewsBox = (function(){
function NewsBox(searchTerm, injectFn) {
this.searchTerm = searchTerm;
sudo npm install -g coffee-script
Kalyse / arrowgasm.less
Created May 9, 2012
LessCSS Mixing for Providing Arrows
View arrowgasm.less
.arrowgasm(@position: top, @size : "4px", @background-color : #88b7d5, @border-width: "2px", @border-color : #c2e1f5, @arrowClass : "arrow_box"){
(~".@{arrowClass}") {
position: relative;
background: @background-color;
border: @size solid @border-color;
(~".@{arrowClass}:after"), (~".@{arrowClass}:before") {
bottom: 100%;
border: solid transparent;
lean8086 / tap-highlight.css
Created Dec 3, 2012
Hide the translucent highlight when elements with hyperlinks are tapped
View tap-highlight.css
a {
/* iOS: Actions without the gray overlay */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS: Remove the actions panel */
-webkit-touch-callout: none;


Some tasks utilize the watch to trigger an event, ie: live reload. With Grunt v0.3, those tasks on first run would create a variable, ie servers. Then subsequently ran by the watch task would check if the variable exists and then use it. Since the new watch spawns tasks, this is no longer possible.

Solutions Proposed

A) Have watch trigger a grunt.event