Skip to content

Instantly share code, notes, and snippets.

View mrmartineau's full-sized avatar
👋
Aho Young Warrior

Zander Martineau mrmartineau

👋
Aho Young Warrior
View GitHub Profile
.border-radius(5px);
.box-shadow(0 1px 3px rgba(0,0,0,.25));
@mrmartineau
mrmartineau / app.min.js
Last active December 15, 2015 11:29
Sublime Closure Compile Build Script. Use a batchfile or shell script to determine which files should be concatinated and minified, then reference that in your Sublime build script
/** //@ sourceMappingURL=app.min.js.map
*/
console.log('foo');console.log('bar');
@mrmartineau
mrmartineau / grunt-watch-livereload-subtask.js
Last active December 18, 2015 05:39
Grunt watch task for compiling scss, js and trigerring a livereload
livereload: {
options: { livereload: true },
files: [
// When these files are changed, livereload is triggered
// Make sure this directory is the same as the one your site points to
'resources/css/styles.css'
]
}
@mrmartineau
mrmartineau / inc-dec.json
Last active December 18, 2015 05:48
Out of date Sublime Text 2 settings
[
{ "keys": ["alt+up"], "command": "inc_dec_value", "args": { "action": "inc_min" } },
{ "keys": ["alt+down"], "command": "inc_dec_value", "args": { "action": "dec_min" } },
{ "keys": ["super+up"], "command": "inc_dec_value", "args": { "action": "inc_max" } },
{ "keys": ["super+down"], "command": "inc_dec_value", "args": { "action": "dec_max" } },
{ "keys": ["super+alt+up"], "command": "inc_dec_value", "args": { "action": "inc_all" } },
{ "keys": ["super+alt+down"], "command": "inc_dec_value", "args": { "action": "dec_all" } }
]
@mrmartineau
mrmartineau / jquery-fallback.html
Created June 9, 2013 22:25
Provide two versions of jQuery, one for old browsers and one for new. See more details at http://martineau.tv/blog/2013/06/two-versions-of-jquery/
<!--[if lte IE 8]>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/libs/jquery.min.js"><\/script>')</script>
<![endif]-->
<!--[if gt IE 8]><!-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/libs/jquery.2.min.js"><\/script>')</script>
<!--<![endif]-->
@mrmartineau
mrmartineau / jquery.data.code.block.js
Created July 13, 2013 18:08
Dave Rupert's data code block jQuery plugin
/* jshint jquery:true */
/* Author: Dave Rupert
* License: WTFPL
----------------------*/
(function($){
'use strict';
$.fn.dataCodeBlock = function(){
@mrmartineau
mrmartineau / prompt.js
Last active December 20, 2015 12:19
Simple script to prompt user if they have not interacted with your page for a given amount of time. The check interval is 6 seconds and currently listens for the `mousemove` event but `scroll` or others can be used equally well.
var PROMPT = {
prompt : false,
interval : 6000,
now : new Date(),
init : function() {
// Do initial check
this.listener();
// console.log(this);