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 PostDashboardView extends Marionette.Layout | |
| template: -> "<div id='posts-region'></div><div id='new-post-region'></div>" | |
| regions: | |
| postsRegion: '#posts-region' | |
| newPostRegion: '#new-post-region' | |
| layout = new PostDashboardView | |
| postsView = new PostsView(collection: new Posts) | |
| newPostView = new NewPostView |
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 PostsWithPaginationView extends Marionette.CompositeView | |
| itemView: PostView | |
| emptyView: NoPostsView | |
| itemViewContainer: '.items' | |
| template: -> "<div class='items'></div><div class='pagination'>" | |
| onRender: -> | |
| # initialize pagination plugin |
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
| # backbone | |
| class PostsView extends Backbone.View | |
| initialize: -> | |
| @collection.on('reset add remove', @render) | |
| @collection.on('request', @startFetch) | |
| teardown: -> | |
| @collection.off('reset add remove', @render) | |
| @collection.off('request' @startFetch) | |
| render: -> | |
| $@el.empty() |
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
| $('#region').html((new PostView(model: model)).render()) # => will render blank in marionette | |
| $('#region').html((new PostView(model: model)).render().$el) # => OK |
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
| # backbone | |
| class PostView extends Backbone.View | |
| className: 'post' | |
| initialize: -> | |
| @model.on('change:rating', @ratingChanged) | |
| teardown: -> | |
| @model.off('change:rating') | |
| # custom plugin cleanup here | |
| @remove() | |
| render: -> |
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
| # backbone | |
| class PostView extends Backbone.View | |
| className: 'post' | |
| initialize: -> | |
| @model.on('change:rating', @ratingChanged) | |
| teardown: -> | |
| @model.off('change:rating') | |
| # custom plugin cleanup here | |
| @remove() | |
| render: -> |
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
| config.around(:each) do |example| | |
| Timecop.freeze if freeze_time? | |
| example.run | |
| Timecop.return if freeze_time? | |
| end | |
| def freeze_time? | |
| example.metadata[:freeze_time] | |
| 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
| function Neville (n : Integer; | |
| x : vector; | |
| xx : Extended; | |
| var f : vector; | |
| var st : Integer) : Extended; | |
| {---------------------------------------------------------------------------} | |
| { } | |
| { The function Neville calculates the value of interpolating polynomial by } | |
| { Neville's algorithm. } | |
| { 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
| function Lagrange (n : Integer; | |
| var x,f : vector; | |
| xx : Extended; | |
| var st : Integer) : Extended; | |
| {---------------------------------------------------------------------------} | |
| { } | |
| { The function Lagrange calculates the value of a polynomial given by } | |
| { Lagrange's interpolation formula. } | |
| { Data: } | |
| { n - number of interpolation nodes minus 1 (the degree of polynomial } |
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 (shExpMatch(host, "*.dev")) { | |
| return "PROXY localhost:3000"; | |
| } | |
| if (shExpMatch(host, "*.dev2")) { | |
| return "PROXY localhost:3001"; | |
| } | |
| if (shExpMatch(host, "*.dev3")) { | |
| return "PROXY localhost:3002"; | |
| } |