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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ | |
[layout prepareLayout]; | |
CGSize size = [layout collectionViewContentSize]; | |
CGRect rect = CGRectMake(0, 0, size.width, size.height); | |
NSArray *layoutAttributes = [layout layoutAttributesForElementsInRect:rect]; | |
for (UICollectionViewLayoutAttributes *attributes in layoutAttributes) { | |
switch (attributes.representedElementCategory) { | |
case UICollectionElementCategoryCell: | |
NSLog(@"Cell"); | |
break; |
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
Set Plain Sprited | |
============================================== | |
About to open file | |
About to read file | |
File content: | |
{ | |
"max-size": 1024 | |
} | |
Could not load config file. Proceeding anyway. What's the worst tha | |
global 0 6 |
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
// VIEW | |
contentView: SC.CollectionView.design({ | |
layout: { top: 0, right: 0, bottom: 0, left: 0 }, | |
contentBinding: 'Ljm.entriesController.arrangedObjects', | |
selectionBinding: 'Ljm.entriesController.selection' | |
}) | |
// CONTROLLER |
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
(function($) { | |
$.fn.fakeSelect = function() { | |
$(this).each(function(idx, element) { | |
var container = $(element), | |
heading = $('h3', element), | |
menu = $('.dropdown', element); | |
container.addClass('fakeselect-js'); | |
heading.click(function() { | |
container.addClass('fakeselect-js-active'); | |
$(document.body).bind('click', function() { |
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
module CT | |
module Git | |
def self.sha(repo) | |
result = `cd "#{repo}" && git log -1 --format=%H`.strip | |
return result =~ /^[0-9a-f]{40}$/ ? result : nil | |
end | |
end | |
end | |
config :sproutcore, :build_number => CT::Git::sha('frameworks/sproutcore') |
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
rootNavigation: SC.Object.create({ | |
treeItemIsExpanded: YES, | |
treeItemChildren: [ | |
SC.Object.create({ | |
name: "Home", | |
icon: 'home-16', | |
show: 'Ljm.HOME' | |
}), | |
SC.Object.create({ | |
name: "Journal", |
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
// View | |
calendar: Ljm.CalendarView.design({ | |
... | |
selectionBinding: 'Ljm.calendarController.selectedDate' | |
... | |
}) | |
// calendarController |
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
MyApp.createController = SC.ObjectController.create({ | |
_store: null, | |
content: null, | |
userBinding: SC.Binding.from('MyApp.currentController.content').oneWay(), | |
create: function() { | |
this._store = MyApp.store.chain(); |
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
/** | |
Takes the created date and returns a fuzzy time string. | |
ie. 2 hours ago, 3 weeks ago. | |
@property | |
*/ | |
prettyDate: function() { | |
var created = this.get('created'), | |
createdMS = created.get('milliseconds'), |
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
# @session and @mock_project instance variables are defined elsewhere. | |
before(:each) do | |
joins = mock(ActiveRecord::Relation) | |
ProjectUser.should_receive(:joins).with(:project_user_datum).and_return(joins) | |
joins.should_receive(:where). | |
with('project_user_data.project_id = :project_id', { :project_id => @mock_project }). | |
and_return(@mock_project) | |
get :index, {}, @session | |
end |
OlderNewer