" Don't quit visual mode after indenting :vmap < >gv
(function($) { | |
$.fn.textfill = function(maxFontSize) { | |
maxFontSize = parseInt(maxFontSize, 10); | |
return this.each(function(){ | |
var ourText = $("span", this); | |
function resizefont(){ | |
var parent = ourText.parent(), | |
maxHeight = parent.height(), | |
maxWidth = parent.width(), | |
fontSize = parseInt(ourText.css("fontSize"), 10), |
#!/bin/sh | |
# | |
# This hook does two things: | |
# | |
# 1. update the "info" files that allow the list of references to be | |
# queries over dumb transports such as http | |
# | |
# 2. if this repository looks like it is a non-bare repository, and | |
# the checked-out branch is pushed to, then update the working copy. | |
# This makes "push" function somewhat similarly to darcs and bzr. |
var directives = ['drag', 'dragstart', 'dragend', 'dragover', 'dragenter', 'drop']; | |
// The HTML5 drag and drop api is the most stupid thing | |
// I've ever seen, but I'm going to use it anyway. | |
angular.forEach(directives, function(dir){ | |
app.directive(dir, [function () { | |
return { | |
restrict: "A", | |
scope: false, |
A document would be simply, an array of objects, visually sortable through a drag and drop interface.
Each object in this array represents a draggable html element rendered on the page. When dragged over another the aforementioned array is resorted. Whenever the array resorts, it will rerender its' contents to the page.
An example of the array of objects that represents a document
documentA = [
arr = [900, 1, 39, 12, 8, 15, 39, 11, 100] | |
quicksort = (arr) -> | |
if(arr.length < 2) | |
return arr | |
unless arr or arr.length > 1 | |
throw new Error 'Input invalid' | |
pivot = arr[0] |
Try extending an item with the class control-label
with the class text-left
, what do you think will happen?
<label class="text-left control-label">Label</label>
Think the label will be left alligned? No!
I wrote a little scripts that shows [some stats about the frameworks](http://juliankrispel.github.io/css-specificity-benchmark/]
##Twitter Bootstrap Size: 16KB Bootstrap seems to be the default for many developers and startups. And I can see why. It has a boatload of fully designed, fully functional components (Not only CSS, also Javascript). It's biggest strength is however also its biggest weakness. Because Bootstrap is so fully featured and so 'designed' already, by picking it you are buying into their way of doing things. Although they vastly improved in their 3.0 release, Bootstrap still struggles with a high rate of specificity which make it hard to extend.
The new version of bootstrap has major advantages over 2.3.2. They shaved off 30% of it's codebase without feature-reduction and is 14% less specific than its predecessor.
var getType = function(thing){ | |
if(thing === null) return "[object Null]"; | |
return Object.prototype.toString.call(thing); | |
} | |
// Determines whether all properties of data are contained in containsData | |
var deepContains = function contains(data, containsData ) { | |
for (var i in data){ | |
var key = i; | |
if(key.indexOf('not_') === 0){ |
#Nice little Vim bits
Reformat in vim for a nice column layout
:%!column -t