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
// don't make functions within a loop | |
model.get('things').then(things => { | |
things.forEach(thing => { | |
thing.get('attachment').then(attachment => { | |
thing.set('foo', true); | |
attachment.set('bar', true); | |
}); | |
}) | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
init() { | |
this._super(...arguments); | |
$.mockjax({ | |
url: '/api/mock', | |
type: "POST", | |
status: 422, |
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
import DS from 'ember-data'; | |
export default DS.ActiveModelAdapter; |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
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
Google JSON StyleGuide | |
link: https://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml?showone=error.code#error.code | |
{ | |
"apiVersion": "2.0", | |
"error": { | |
"code": 404, | |
"message": "File Not Found", | |
"errors": [{ | |
"domain": "Calendar", | |
"reason": "ResourceNotFoundException", |
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
// Object Error(s): Current/Proposed | |
{ | |
“errors”: { | |
“base”: [ | |
“you can not do that”, | |
“nice try fool” | |
], | |
“first_name”: [ | |
“can not be blank”, | |
“must include a capital letter” |
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
App.LocationEditController = Em.ObjectController.extend({ | |
productList: [], | |
unassignedProducts: (function() { | |
var res; | |
res = this.store.find('product').then((function(_this) { | |
return function(products) { | |
return _this.store.find('locationProduct', { | |
by_location_id: 1 | |
}).then(function(locationProducts) { | |
var productIds; |
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
self.encryptForm = function (form) { | |
var element, encryptedValue, | |
fieldName, hiddenField, | |
i, inputs; | |
form = extractForm(form); | |
inputs = findInputs(form); | |
while (hiddenFields.length > 0) { | |
try { |
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
foo = [] | |
foo["bar"] = "bat" |
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
{ | |
"folder_exclude_patterns": | |
[ | |
"production", | |
".svn", | |
".git", | |
".hg", | |
"CVS", | |
"node_modules", | |
"tmp" |
NewerOlder