Joined September 2012
·

Ulises Ramirez-Roche

Web Developer at ulisesrmzroche
·
Texas
·
·
·

Posted to Ember CLI, Staging, and You over 1 year ago

passing --proxy is about to be deprecated, see https://github.com/stefanpenner/ember-cli/issues/1601

This tip is really old, and so is that blog post. You should not be using Em.Run loops in your app normally, check the API: http://emberjs.com/api/classes/Ember.run.html. That's for raw event handlers, not app initializers.

You should not have any problems with .('on') like @mfeckie said, though.

By declaring ApplicationView, we are over-riding the default one in order so we can initialize foundation. We put this call inside the didinsertElement hook, which makes sure that whatever template is attached to the view is rendered on the screen before firing it.

ApplicationView is the first View object that is instantiated by Ember, and is directly tied to ApplicationRoute, which is the first Route Object created by Ember. By choosing to attach this call to ApplicationView, we can be sure that foundation will have been initialized before we enter any child routes that also depend on Foundation, but after the app is in the process of rendering and setting up views, which is the proper place for plugins that interface with your templates, like Foundation.

The Bad Practice is doing this

Em.Application.create({
ready: function(){
$(document).foundation()
}
});

which is definitely going to initialize foundation at the wrong time, maybe even before jQuery and Foundation are pulled in, which would probably crash the app if you're not being careful.

The other line is Em.$(document).foundation, which is initializing foundation by calling Ember's reference to jQuery. I like the way it sounds outloud and also makes sure we are calling the jQuery that you attached to Ember. Using $ sign by itself, depending on your build setup, can suffice. But it's really a safer bet to reference Ember's jQuery, which you know for sure is compatible with Ember and also has been instantiated at the right time in the render line.

This code is pretty old though. A more idiomatic way of saying this would be

App.ApplicationView = Em.View.extend({

initFoundation: function(){

return Em.$(document).foundation();

}.on('didInsertElement')

which takes advantage of listening on the ember view lifecycle.

Posted to LiveReload on Nitrous.IO over 1 year ago

Nitrous recently launched Nitrous Desktop, which allows you to forward ports really easily, right from a GUI.

Posted to Best way to leave insert mode over 1 year ago

If you don't want Vim to check for abbreviatons or autocommand events, though. Ctrl-[, on the other hand, behaves just like the escape key.

Achievements
157 Karma
11,201 Total ProTip Views