Skip to content

Instantly share code, notes, and snippets.

View subhaze's full-sized avatar

Michael Russell subhaze

View GitHub Profile
@subhaze
subhaze / .gitconfig
Created April 2, 2012 22:42
current gitconfig setup that I've pieced together with personal stuff and things found on teh internets
[color]
# turn on color
diff = auto
status = auto
branch = auto
interactive = auto
ui = auto
[color "branch"]
current = green bold
local = green
@subhaze
subhaze / gist:2910735
Created June 11, 2012 15:41
HTML: HTML5 skeleton
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" media="screen" href="assets/stylesheets/css/master.css" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@subhaze
subhaze / event_delegate.js
Created September 4, 2012 01:44
Vanilla event delegation
var delegate = (function(){
var match = (function(){
var guineaPig = document.createElement('div');
if(guineaPig.matchesSelector) return function(elem, selector){
return elem.matchesSelector(selector);
};
if(guineaPig.mozMatchesSelector) return function(elem, selector){
return elem.mozMatchesSelector(selector);
};
@subhaze
subhaze / cause-mootools-is-cool.js
Last active December 19, 2015 12:58
'Cause mootools is cool.
jQuery.moo = {
substitute: function(str, object, regexp){
return String(str).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
if (match.charAt(0) == '\\') return match.slice(1);
return (object[name] != null) ? object[name] : '';
});
}
};
@subhaze
subhaze / Preferences.sublime-settings
Created August 11, 2013 16:19
Sublime Text 3 Settings
{
"auto_complete_commit_on_tab": true,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin, text.haml",
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
@subhaze
subhaze / .gitignore
Last active December 26, 2015 05:59
personal, global, .gitignore for work
## Use the file below (.gitkeep) to ensure git keeps up with the directory
## - Useful if you need to ignore entire contents but keep the folder intact.
!.gitkeep
### OSX
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
@subhaze
subhaze / ga-event.js
Last active April 4, 2023 20:08
quick and dirty GA event tag dispatcher for jQuery
// GA event tracking
// example usage: (a button is used but any HTML element can be used.)
//
// <button data-ga-track-event='["category", "action", "opt_label", "opt_value", "opt_noninteraction"]'>some action</button>
//
// NOTICE: the usage of '' to wrap the attribute value and the "" used for strings
// This is important since it MUST be valid JSON
$(document.body).on('click', '[data-ga-track-event]', function(e){
var trackData = $(this).data('ga-track-event');
if(!$.isArray(trackData)) throw new Error('[data-ga-track-event] must be a valid JSON array');
@subhaze
subhaze / .tern-project
Created March 29, 2014 01:09
Setup node module completions in Tern.js
{
"libs": [
],
"plugins": {
"node": {}
}
}
@subhaze
subhaze / README-Makefiles.md
Last active August 29, 2015 13:57
A collection of no frills Makefiles for JS building, CSS building, and deployments

You can combine all these makefiles into one, or, use a master Makefile that calls these.

For auto building you can use watch or if your editor supports build tools call the makefiles on save.

@subhaze
subhaze / Makefile
Created April 2, 2014 00:27
Quick and to the point Makefile for rsync deploys
deploy:
rsync -a --delete ./ username@hostname:/path/to/web/root
.PHONY: deploy