This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// override the default reset-box-model because it sets outline: 0 which is naughty | |
reset-box-model() { | |
margin: 0 | |
padding: 0 | |
border: 0 | |
} | |
global-reset() | |
reset-html5() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jquery.offsets.coffee | |
# Rob Middleton - MIT License | |
define (require) -> | |
$ = require 'jquery' | |
cssObjectAdd = (object, left, top) -> | |
object.left += left |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
# A quick and dirty script to find non-required files when using requirejs | |
# r.js outputs the required file names so we just parse that and diff it with the files on disk | |
# npm install -g coffee-script | |
# npm install file path underscore | |
# then | |
# run this like this: ./unused.coffee grunt --no-color requirejs:prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quickly switch between files with the same name but a different extension | |
# add a shortcut to your user keymap file | |
# { "keys": ["super+alt+enter"], "command": "fast_switch" } | |
import sublime, sublime_plugin, os.path | |
def findfolder (file, folders): | |
for folder in folders: | |
if file.find(folder) == 0: | |
return folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// public domain, use it for whatever | |
// returns "calc", "-moz-calc", etc | |
// (no -ms because they already support it non-prefixed) | |
function prefixedCalc () { | |
var prefixes = ["","-webkit-","-moz-","-o-"], el | |
for (var i = 0; i < prefixes.length; i++) { | |
el = document.createElement('div') | |
el.style.cssText = "width:" + prefixes[i] + "calc(9px)" | |
if (el.style.length) return prefixes[i] + "calc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function () { | |
var Modernizr | |
// run cb when the next animation is complate (or right away if there is no animation support) | |
var cssTransitionEnd = function (cb) { | |
var $self = $(this) | |
var transEndEventNames = { | |
'WebkitTransition' : 'webkitTransitionEnd', | |
'MozTransition' : 'transitionend', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use this as a starting point when adding a view | |
define([ | |
'text!views/-------.html', | |
'views/View' | |
], | |
function ( | |
template, | |
View |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There is no way to have the html editor open and not be inspecting. - because of this It is very hard to use, in order to see the whole page with no dimming I have to completely close the inspector | |
Bug: 2 tabs next to each other both with html inspector open, one tab without to the right, using keyboard shortcut (cmd-shift-[) quickly switch 2 tabs over. | |
Can't hover over htmelements in inspector to highlight it in the dom, have to click. | |
CSS changes don't update until you click off, would prefer on keyup. | |
no css attribute autocomplete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return View.extend({ | |
initialize: function () { | |
this.el.attr("draggable", "true") | |
this.el.bind("dragstart", _.bind(this._dragStartEvent, this)) | |
}, | |
_dragStartEvent: function (e) { | |
var data | |
if (e.originalEvent) e = e.originalEvent | |
e.dataTransfer.effectAllowed = "copy" // default to copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery plugin that uses modernizr to detect css3 transition support and listens for transitionEnd or calls back right away if transitions are not supported | |
// basically send this a cb and it will be run on transitionEnd or right away if transitionEnd is not supported | |
jQuery.fn.cssTransitionEnd = function (cb) { | |
// lifted from http://www.modernizr.com/docs/ | |
var transEndEventNames = { | |
'WebkitTransition' : 'webkitTransitionEnd', | |
'MozTransition' : 'transitionend', | |
'OTransition' : 'oTransitionEnd', |