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
@model.comments.fetch | |
success: => | |
commentListView = new CommentListView | |
collection: @model.comments | |
fetchOnInit: false | |
title: 'All comments' | |
$(@el).append commentListView.render().el |
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
def within_box_or_near(location_class, box, center) | |
box.present? ? location_class.within_box(box) : location_class.near(center) | |
end | |
def filter(params) | |
locations = {} | |
within_box_or_near(Location.class_for_provider(services.shift), @box, @center).each do |location| | |
locations[location.loc_hash] = location |
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
# Uses 101 (also known as n + 1 where n = 100) queries | |
mergeTransactionsBad: -> | |
all_transactions = [] | |
te_transactions = db.run "select * from te_transactions where member_id=1 order by posted_at DESC limit 100" | |
for transaction in te_transactions | |
network_transaction = db.run "select * from network_transactions where transaction_id=#{transaction.id}" | |
transaction.member_id = network_transaction.id |
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
{ styles } = require 'helpers' | |
PayoffOverview = require 'views/accounts/payoff/overview' | |
module.exports = class PayoffWindow extends Backbone.TitaniumView | |
viewName: 'Window' | |
attributes: styles.window.main |
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
styles = require('styles').ui | |
KitchenSink = require './main' | |
{ Button, Window } = require 'views/ui' | |
module.exports = class IntroView extends Window | |
render: => |
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
styles = require('styles').ui | |
{ Button, Window } = require 'views/ui' | |
module.exports = class IntroView extends Window | |
render: => | |
@layout (view) => |
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
styles = require('styles').ui | |
{ Button, ContentBlock, Window } = require 'views/ui' | |
module.exports = class IntroView extends Window | |
render: => | |
@layout (view) => |
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
* Case Conversion | |
* Backbone - Trabian (custom plugin) | |
* ChangeQuotes | |
* CoffeeScript | |
* CTags (with coffeescript ctags) | |
* Git | |
* GitHubinator | |
* Guard (prevents need to keep a separate terminal open for running guard) | |
* Jade | |
* Origami |
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
class ExtendedView extends View | |
clicked: false | |
events: | |
'click #someChild': 'clickMethod' | |
render: => | |
Backbone.$('<View>') |
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
# Default Titanium API | |
button = Ti.UI.createButton | |
title: 'Testing' | |
button.addEventListener 'click', -> | |
alert 'Click!' | |
return | |
@view.add button |
OlderNewer