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
def setupHomeImage | |
homeImage = UIImageView.alloc.initWithImage(UIImage.alloc.initWithContentsOfFile(File.join(App.resources_path, 'home.png'))) | |
homeImage.frame = CGRectMake(0, -8,self.view.size.width, 290) | |
homeImage.contentMode = UIViewContentModeScaleAspectFit | |
self.view.addSubview homeImage | |
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
controller do | |
skip_authorization_check | |
def test | |
render nothing: true | |
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
describe 'options_for_input' do | |
subject { options_for_input field } | |
before(:each) do | |
mock(helper).translated_label(anything) { 'label' } | |
mock(helper).select_options(anything) { ['option'] } | |
end | |
context 'field is a boolean' do |
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
def self.process_map_reduce(query) | |
debugger | |
query.find.to_a.inject({}) do |acc, current| | |
acc[current['_id']] = current['value']; acc | |
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
Form.map_reduce(mr.map_incorrect_count, mr.reduce_sum) | |
--- | |
map_incorrect_count: | |
"function() { | |
if(!this.components) return; | |
this.components.forEach(function(c) { | |
if(c.verification_result === 'incorrect') { | |
emit(c.short_label, 1); | |
} |
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
startLiveDataSyncing: -> | |
window.setInterval GotApp.SearchFilter.current().search(null, false), (5 * 60 * 1000) # 5min | |
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 GotApp.SearchVenuesController extends Panel | |
title: I18n.t('title') | |
className: 'search-venues' | |
className : 'search-venues' | |
elements : | |
'.last-search' : 'elLastSearchButton' | |
'.search-venues-day-of-week' : 'elSearchVenuesDayOfWeek' | |
'#search-venue-filter-list' : 'filterList' |
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 Foo | |
constructor:(@a) -> | |
bar: | |
funcA: -> | |
console.log @a | |
objA = new Foo('hello') | |
objB = new Foo('hello') |
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
@capacitySort: (v1, v2) -> | |
if v1.capacity.live && v2.capacity.live | |
if parseFloat(v1.capacity.live) >= parseFloat(v2.capacity.live) then -1 else 1 | |
else if v1.capacity.live || v2.capacity.live | |
if parseFloat(v1.capacity.live) >= parseFloat(v2.capacity.live) then -1 else 1 | |
else | |
day = GotApp.SearchFilter.current().day | |
if parseFloat(v1.capacity[day]) >= parseFloat(v2.capacity[day]) then -1 else 1 |
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 UpdatingAnExistingObject < Spinach::FeatureSteps | |
include SharedPaths | |
include SharedForms | |
include SharedObject | |
include SharedAuthentication | |
When "I click the object's name" do | |
click_link @object.name | |
end |