In addition to the techniques described in the
Asynchronous Routing Guide,
the Ember Router provides powerful yet overridable
conventions for customizing asynchronous transitions
between routes by making use of error
and loading
substates.
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
[user] | |
name = Ben Hyrman | |
email = ben.hyrman@gmail.com | |
[core] | |
autocrlf = true | |
editor = vim | |
excludesfile = C:\\Users\\Ben\\Documents\\gitignore_global.txt | |
[credential] | |
helper = !~/AppData/Roaming/GitCredStore/git-credential-winstore | |
[merge] |
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
[1] pry(main)> Class.new.respond_to?(:define_method) | |
=> false | |
[2] pry(main)> Module.new.respond_to?(:define_method) | |
=> false | |
[3] pry(main)> Class.new.send(:define_method, :yup) {} | |
=> #<Proc:0x00000100a08cb8@(pry):3 (lambda)> | |
[4] pry(main)> Module.new.send(:define_method, :yup) {} | |
=> #<Proc:0x00000100d8f468@(pry):4 (lambda)> |
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
Namespace.extend = (src, obj = {}) -> | |
if typeof obj.init is 'function' | |
newObj = obj.init | |
delete obj.init | |
else | |
newObj = -> | |
newObj.prototype = Object.create src.prototype | |
newObj.prototype.constructor = newObj | |
for prop of obj |
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
// Because people can't seem to find the gist description, here is the source | |
// of this code, a post found in last weeks JS Weekly, it is not my code | |
// http://www.angularails.com/articles/creating_simple_directive_in_angular | |
angular.module('ui-multi-gravatar', []) | |
.directive('multiAvatar', ['md5', function (md5) { | |
return { | |
restrict: 'E', | |
link:function(scope, element, attrs) { |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
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
{ | |
"title": "Collectd: Blackbox", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "plugin:\"load\"", | |
"alias": "Load", | |
"color": "#7EB26D", | |
"id": 0, |
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
# Using these pry gems -- copy to your Gemfile | |
# group :development, :test do | |
# gem 'awesome_print' # pretty print ruby objects | |
# gem 'pry' # Console with powerful introspection capabilities | |
# gem 'pry-byebug' # Integrates pry with byebug | |
# gem 'pry-doc' # Provide MRI Core documentation | |
# gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB | |
# gem 'pry-rescue' # Start a pry session whenever something goes wrong. | |
# gem 'pry-theme' # An easy way to customize Pry colors via theme files | |
# end |
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
- Use Ember CLI
- In general, replace views + controllers with components
- Only use controllers at the top-level for receiving data from the route, and use
Ember.Controller
instead ofEmber.ArrayController
orEmber.ObjectController
- Fetch data in your route, and set it as normal properties on your top-level controller. Export an
Ember.Controller
, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.