Skip to content

Instantly share code, notes, and snippets.

View joe-watkins's full-sized avatar

Joe Watkins joe-watkins

View GitHub Profile
@joe-watkins
joe-watkins / plugin-starter.js
Last active June 5, 2016 23:08
Vanilla JS plugin starter
var someCoolPlugin = function(options){
// defaults
var defaults = {
el: ".anchor-to-button",
killHref: true,
parent: document
}
// loop through defaults
@joe-watkins
joe-watkins / gulpfile.js
Created May 6, 2016 14:15 — forked from demisx/gulpfile.js
Gulp 4 gulpfile.js
// Gulp 4
var gulp = require('gulp');
var using = require('gulp-using');
var grep = require('gulp-grep');
var changed = require('gulp-changed');
var del = require('del');
var coffee = require('gulp-coffee');
var less = require('gulp-less');
var coffeelint = require('gulp-coffeelint');
var sourcemaps = require('gulp-sourcemaps');
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" style="display:none"><defs><filter id="a" filterUnits="userSpaceOnUse" x="0" y=".052" width="34.092" height="34.093"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/></filter></defs><symbol id="icon-arrow-left" viewBox="0 0 24 24"><path fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width="2" d="M15.5 21l-9-9 9-9"/></symbol><symbol id="icon-arrow-right" viewBox="0 0 24 24"><path fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width="2" d="M8.5 3l9 9-9 9"/></symbol><symbol id="icon-camera" viewBox="0 0 37 24"><title>ios-videocam - Ionicons</title><path d="M22.72.875c.82 0 1.508.278 2.064.835.557.557.835 1.245.835 2.065V20.3c0 .82-.28 1.537-.837 2.152-.556.615-1.245.923-2.065.923H3.294c-.82 0-1.553-.308-2.197-.923C.453 21.837.13 21.12.13 20.3V3.774c0-.82.308-1.508.924-2.065.615-.558 1.362-.836 2.24-.836H22
@joe-watkins
joe-watkins / LICENSE.txt
Last active August 29, 2015 14:23 — forked from 140bytes/LICENSE.txt
Detect Missing Alt Tags - 140byt.es
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
@joe-watkins
joe-watkins / Readme
Last active August 29, 2015 14:23
stockEase.js - simple jQuery plugin for outputting stock information from Yahoo's Finance API - Dependencies: Mustache.js / jQuery
Coming soon
@joe-watkins
joe-watkins / gist:6b65f01b6cdeae8c4731
Last active August 29, 2015 14:16
Test to see if HTML5 Video is buffered.
/*
Tests to see if video has been buffered.
html5VideoBufferedTest(player,showVideo);
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement
*/
var html5VideoBufferedTest = function(videoObject,callback_function){
videoBuffered = false;
setInterval(function(){
@joe-watkins
joe-watkins / gist:710e5aa49a35382d6464
Last active January 17, 2022 11:44
Test for HTML5 video autoplay support.
/*
Test for HTML5 video autoplay support. Adds .video-autoplay or .no-video-autoplay to <HTML>
Makes a global 'autoplay' variable available
Pass a delay & callback function to run if device supports autoplay
Use case: Some mobile devices do not allow for autoplay. With this you can detect those devices.
Usage: html5VideoTest(500,callback);
Source: http://stackoverflow.com/questions/7120703/how-do-i-detect-if-the-html5-autoplay-attribute-is-supported
Minified version below
*/
module.exports = function(grunt) {
grunt.initConfig({
taskName: {
// meow
}
});
@joe-watkins
joe-watkins / gist:85e87940847964a507d8
Last active August 29, 2015 14:13
Bulletproof Base64 template
@font-face {
font-family: 'MyFontFamily';
src: url('myfont-webfont.eot?') format('embedded-opentype');
}
@font-face {
font-family: 'MyFontFamily'
url(data:font/opentype;base64,BASE64_ENCODED_DATA_HERE) format('truetype'),
url(data:font/woff;charset=utf-8;base64,BASE64_ENCODED_DATA_HERE) format('woff'),
url('myfont-webfont.svg#svgFontName') format('svg');
@joe-watkins
joe-watkins / gist:38939aa308be1fe1377f
Created January 8, 2015 19:18
kill respond.js IE8 w/forced width
// css
.site-wrapper {
.lt-ie9 { width: 1200px; margin: 0 auto; }
}
// js
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia = window.matchMedia || (function( doc, undefined ) {