This file contains hidden or 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
class SomeService | |
def initialize(some_dependency) | |
@some_dependency = some_dependency | |
end | |
def some_event(value) | |
@some_dependency.another_event(value.increase_value) | |
end | |
end |
This file contains hidden or 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
class CommentsController < ApplicationController | |
def create | |
translator.translate params | |
end | |
private | |
def translator | |
CommentRequestTranslator.new(processor) |
This file contains hidden or 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
class SomeController < ApplicationController | |
... | |
def update | |
ui = SomeViewAdapter.new | |
domain = SomeDomain.new(ui) | |
translator = SomeRailsAdapter.new(domain) | |
translator.some_action(params) | |
#some processing based upon ui values in order to know what view to render, etc | |
end |
This file contains hidden or 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
/* Imagine that you have a publish/subscribe system where you want a publisher to publish messages to a set of subscribers. There are two ways that you can specify the message to send, with a function to call on the object, and with a string.*/ | |
//Functional subscription (Essentially a partially applied function) | |
publisher.addListener('someEvent', subscriber.someResult, subscriber); | |
//This ends up having code that looks something like this: | |
addListener: function(eventName, functionToCall, subscriber) { | |
this._events[eventName].push({functionToCall: functionToCall, context: subscriber}); | |
}, | |
... | |
invoke: function(eventName, data) { |
This file contains hidden or 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 matchersForFilter = function(properties) { | |
var attributes = util.keys(properties); | |
var attributesFilters = util.values(properties); | |
var arraysWithAttributeAndAttributesFilters = util.zip(attributes, | |
attributesFilters); | |
var arrayOfMatchersForAttribute = | |
util.map(arraysWithAttributeAndAttributesFilters, matchersForAttribute); | |
var matchers = util.flatten(arrayOfMatchersForAttribute, true); |
This file contains hidden or 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 Deferred = require('shared/deferred').Deferred; | |
var Repository = require('shared/repository').Repository; | |
... |
This file contains hidden or 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
{{#if booleanA}} | |
{{propertyA}} | |
{{/if}} | |
{{#if booleanB}} | |
{{propertyB}} | |
{{/if}} | |
//should be |
This file contains hidden or 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.StartedState = SC.State.extend({ | |
enterState: function() { | |
//do some stuff | |
this.setupRoutes(); | |
}, | |
exitState: function() { | |
//remove some stuff | |
}, |
This file contains hidden or 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
<table> | |
<tbody tabindex="-1" id="sc201" class=""> | |
<tr tabindex="-1" id="sc210" class="" style=""> | |
<td tabindex="-1" id="sc214" class="" style=""><span tabindex="-1" id="sc216" class="" style="">something</span></td> | |
<td tabindex="-1" id="sc220" class="" style=""><span tabindex="-1" id="sc221" class="" style="">new</span></td> | |
</tr> | |
<tr tabindex="-1" id="sc225" class="" style=""> | |
<td tabindex="-1" id="sc228" class="" style=""><span tabindex="-1" id="sc229" class="" style="">something</span></td> | |
<td tabindex="-1" id="sc232" class="" style=""><span tabindex="-1" id="sc233" class="" style="">else</span></td> | |
</tr> |
This file contains hidden or 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
list: SC.ScrollView.extend({ | |
layout: {height:190}, | |
contentView: SC.TemplateCollectionView.extend({ | |
contentBinding: 'TW.homePageTabsController.contentRecentSearches', | |
itemView: SC.TemplateView.extend(TW.ItemViewSelectionSupport, { | |
templateName: 'home_page_tabs_recent_search_item', | |
classNames: ['simple-link-row'], | |
performAction: function() { | |
TW.statechart.sendEvent('performRecentSearch', this.get('content')); |
NewerOlder