Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
node_modules/A/node_modules/B/node_modules/C/all.js |
var Lounge = Backbone.View.extend({ | |
initialize: function (options) { | |
// ... | |
Bus.listen('window.inViewport', () => { | |
this.states.inViewport = true; | |
this.trigger('inViewport'); | |
}); | |
Bus.listen('window.scrollOffViewport', () => { |
App = Ember.Application.create({}); | |
App.loginController = Ember.Object.create({ | |
// do login stuff | |
}); | |
App.LoginFormView = Ember.View.extend({ | |
login: null, | |
password: null, |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
Recently, we've been working on extracting Ember conventions from applications we're working on into the framework. Our goal is to make it clearer how the parts of an Ember application work together, and how to organize and bootstrap your objects.
Routing is an important part of web applications. It allows your users to share the URL they see in their browser, and have the same things appear when their friends click on the link.
The Ember.js ecosystem has several great solutions for routing. But, since it is such an important part of most web applications, we've decided to build it right into the framework.
If you have already modeled your application state using Ember.StateManager
, there are a few changes you'll need to make to enable routing. Once you've made those changes, you'll notice the browser's address bar spring to life as you start using your app—just by moving between states, Ember.js will update the URL automatically.
.shadow-stuff { | |
-moz-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
-webkit-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
-moz-box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
-webkit-box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
} | |
.container { |
var stream = require("fake-stream-lib"), | |
Emitter = require("events").EventEmitter, | |
util = require("util"); | |
// Today... | |
function Device( opts ) { | |
this.value = null; |
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |