Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
$.fn.queueAnim = function (steps, callback) { | |
var $selector = this; | |
function iterator(step) { | |
step.push(iterate); | |
$selector.animate.apply($selector, step); | |
} | |
function iterate() { | |
if (!steps.length) return callback && callback(); |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
function intervalMixin() { | |
var intervals = []; | |
return { | |
addInterval: function (func, delay) { | |
intervals.push({ func: func.bind(this), delay: delay }); | |
}, | |
startIntervals: function () { | |
intervals.forEach(function (interval) { |
var foo = function () { | |
console.log(this); | |
console.log(arguments); | |
} | |
var context = {}; | |
// shortcut with predefined context and arguments | |
var bar = Function.prototype.call.bind(foo, context, 'arg1', 'arg2'); | |
bar('arg3'); // context, ["arg1", "arg2", "arg3"] |
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 |
function toArray(args) { | |
return [].slice.call(args); | |
} | |
function autocurry(fn) { | |
var len = fn.length; | |
var args = []; | |
return function next() { | |
args = args.concat(toArray(arguments)); | |
return (args.length >= len) ? |
var splice = Array.prototype.splice; | |
function arraySplice(array1, array2) { | |
return splice.apply(array1, [0, array2.length].concat(array2)); | |
} |
// backbone.record | |
(function (Backbone) { | |
"use strict"; | |
var api = { | |
initialize: function () {}, | |
removeAll: function () { |
'use strict'; | |
define( | |
['./provider'], | |
function (provider) { | |
function AsCollection() { |
(function (root, factory) { | |
if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else if (typeof define === 'function' && define.amd) { | |
define(factory); | |
} else { | |
root.returnExports = factory(); | |
} | |
}(this, function () { | |
return {}; |