cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus
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
//Put your real collection constructors here. Just examples. | |
var collections = { | |
Languages: Backbone.Collection.extend(), | |
ProductTypes: Backbone.Collection.extend(), | |
Menus: Backbone.Collection.extend() | |
}; | |
function fetch() { | |
$.getJSON("/url/to/your/big.json", { | |
success: function (response) { |
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
var model = new Backbone.Model(); | |
model.set({contacts: new ContactsModel(), users: new UsersModel()}); | |
var view = new GridView({model: model}); | |
var contacts = new ContactsModel(); | |
var users = new UsersModel(); | |
var view = new GridView({model: contacts, users: users}) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js"></script> | |
<meta charset=utf-8 /> | |
</head> | |
<body> | |
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
fullsize: function(ev) { | |
var target = ev.currentTarget; | |
var self = this; | |
$('.drop-shadow').click(function(inner_ev) { | |
console.log(this.id); // the same as inner_ev.currentTarget | |
console.log(self.cid); // the containing view's CID |
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
// Below is the source code pick from angular.js | |
// Read source code help us more clearer | |
// the difference between service, factory, provider | |
function provider(name, provider_) { | |
if (isFunction(provider_) || isArray(provider_)) { | |
provider_ = providerInjector.instantiate(provider_); | |
} | |
if (!provider_.$get) { | |
throw Error('Provider ' + name + ' must define $get factory method.'); | |
} |
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
{ | |
"window.zoomLevel": 2, | |
"workbench.colorTheme": "Night Owl", | |
"workbench.iconTheme": "material-icon-theme", | |
"workbench.sideBar.location": "left", | |
"editor.minimap.enabled": false, | |
"explorer.confirmDelete": false, | |
"javascript.updateImportsOnFileMove.enabled": "always", | |
"git.confirmSync": false, | |
"extensions.ignoreRecommendations": false, |