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
# This won't be live if bars is a hasMany relationship | |
foo.get 'bars' | |
# Instead do this and use the patch below to get a live array: | |
hasManyHack foo, 'bars' | |
# workaround for https://github.com/emberjs/data/issues/1308 - | |
# once the SSOT branch is merged this should be able to be replaced |
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
docker images | grep '<none>' | awk '{print $3}' | xargs docker rmi |
If you have worked much with Ember-Data, then you know the buffered object proxy pattern:
http://coryforsyth.com/2013/06/27/ember-buffered-proxy-and-method-missing/
This pattern allows us to put changes to a model into a buffer instead of on the model itself. There are several benefits of this:
- If the model has changes come from a push source (an attribute is updated), the changes will not destroy what the user is currently entering.
- Saves can be de-coupled from dirty tracking. If you are saving a model as a user types, the model in flight will not accept changes from the user. You will get the dreaded
cannot change an object inFlight
error. With a buffer, you can commit the buffer to the model and save the model, then allow the user to keep making edits against a new buffer. No conflict. - In general, a buffer allows you to treat Ember-Data records more like database rows. You lock them for modification (while persisting them) but only for the shortest time possible. An object is made dirty then sav
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
# Add a link to itself in its own node_modules directory: | |
npm link && npm link app-name |
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
scrollTimeout: 100, | |
boundingClientRect: 0, | |
windowHeight: 0, | |
windowWidth: 0, | |
_updateBoundingClientRect: function() { | |
var el; | |
el = this.$()[0]; | |
this.set('boundingClientRect', el.getBoundingClientRect()); | |
}, |
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 fs = require('fs'); | |
var child_process = require('child_process'); | |
var spawn = child_process.spawn; | |
function openEditor(file) { | |
var cp = spawn(process.env.EDITOR, [file], { | |
customFds: [ | |
process.stdin, | |
process.stdout, | |
process.stderr |
OlderNewer