fetch pull request locally:
git fetch upstream refs/pull/{number}/head:{local_branch}
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
You can reset your branch to the state it was in just before the merge if you find the commit it was on then. | |
One way is to use git reflog, it will list all the HEADs you've had. | |
I find that git reflog --relative-date is very useful as it shows how long ago each change happend. | |
Once you find that commit just do a git reset --hard <commit id> and your branch will be as it was before. |
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
The problem is that steps.[].stepStatus is not a valid dependent key anymore. You should replace it by steps.@each.stepStatus. | |
Here is a summary of valid and invalid dependent keys in current Ember versions: | |
array - this observes if the array reference itself changes, e.g replacing the entire array with another value or array such as that oldValue !== newValue. | |
array.[] - this observes both when the array itself changes (above) and when the array length changes (functionally equivalent of array.length) | |
array.@each.property - observes both cases above and when property of some of the array's items change | |
array.@each.{prop,anotherProp} - you can also observe multiple properties while specifying only one key. This expands to array.@each.prop and array.@each.anotherProp. | |
array.@each - isn't valid anymore, no trailing @each. Use .[] instead. | |
array.@each.property.property - Also not valid. Note that @each only works one level deep. You cannot use nested forms like todos.@each.owner.name or todos.@each.owner.@each |
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
// http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/ | |
// JavaScript regex trick: Parse a query string into an object | |
var queryString = {}; | |
anchor.href.replace( | |
new RegExp("([^?=&]+)(=([^&]*))?", "g"), | |
function($0, $1, $2, $3) { queryString[$1] = $3; } | |
); | |
// Usage |
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
`JSONSerializer` will normalize the JSON payload to the JSON API format that the | |
Ember Data store expects. | |
You can customize how JSONSerializer processes its payload by passing options in | |
the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks: | |
- To customize how a single record is normalized, use the `normalize` hook. | |
- To customize how `JSONSerializer` normalizes the whole server response, use the | |
`normalizeResponse` hook. | |
- To customize how `JSONSerializer` normalizes a specific response from the server, | |
use one of the many specific `normalizeResponse` hooks. | |
- To customize how `JSONSerializer` normalizes your id, attributes or relationships, |
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
http://blog.trackets.com/2013/02/08/router-request-lifecycle.html | |
Router Request Lifecycle | |
enter (private) | |
activate - executed when entering the route | |
deserialize (private) | |
model (formely deserialize) - takes the params and returns a model which is set to the route's currentModel | |
serialize - used to generate dynamic segments in the URL from a model | |
setupController - takes currentModel and sets it to the controller's content by default | |
renderTemplate - takes current controller and what model returns and renders the template with an appropriate 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
vehicle: '', | |
vehicles: [1,2,3], | |
}); |
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
delegate methods to proxy object | |
proxyToContent = (method) -> | |
-> | |
content = Ember.get(@, 'content'); | |
content[method].apply(content, arguments) | |
appointment: Ember.computed 'pet.id', -> | |
appointment = Promise() |
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
COMPONENT LIFECYCLE HOOKS | |
A number of new component lifecycle hooks have been introduced to Ember 1.13. Using these hooks allows you to write data down, action up (DDAU) style components today, despite the two-way data binding of curly components. | |
On first render (in order): | |
didInitAttrs runs after a component was created and passed attrs are guaranteed to be present. In Ember 1.13, the attributes will be available as this.get('attrName'). | |
didReceiveAttrs runs after didInitAttrs, and it also runs on subsequent re-renders, which is useful for logic that is the same on all renders. It does not run when the component has been re-rendered from the inside. | |
willRender runs before the template is rendered. It runs when the template is updated for any reason (both initial and re-render, and regardless of whether the change was caused by an attrs change or re-render). | |
didInsertElement runs after the template has rendered and the element is in the DOM. |
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
Процесс обработки WEB-страницы браузером | |
Для начала, рассмотрим последовательность работы браузера при отображении документа: | |
Из полученного от сервера HTML-документа формируется DOM (Document Object Model). | |
Загружаются и распознаются стили, формируется CSSOM (CSS Object Model). | |
На основе DOM и CSSOM формируется дерево рендеринга, или render tree — набор объектов рендеринга (Webkit использует термин «renderer», или «render object», а Gecko — «frame»). Render tree дублирует структуру DOM, но сюда не попадают невидимые элементы (например — <head>, или элементы со стилем display:none;). Также, каждая строка текста представлена в дереве рендеринга как отдельный renderer. Каждый объект рендеринга содержит соответствующий ему объект DOM (или блок текста), и рассчитанный для этого объекта стиль. Проще говоря, render tree описывает визуальное представление DOM. | |
Для каждого элемента render tree рассчитывается положение на странице — происходит layout. Браузеры используют поточный метод (flow), при котором в большинс |