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
map.connect 'questions/:id/:tags/:question', | |
:controller => 'questions', | |
:action => 'show', | |
:tags => 'question', | |
:question => nil | |
module ApplicationHelper | |
def question_path(question, extra_params=true) | |
options = {} |
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
trips = find_by_sql( | |
"select trips.* from trips, | |
(select * from stop_times where stop_times.stop_gid = '#{params[:from]}' | |
order by stop_times.departure_time) as dep_stop_times, | |
(select * from stop_times where stop_times.stop_gid = '#{params[:to]}' | |
order by stop_times.departure_time) as dest_stop_times | |
WHERE trips.service_gid = '#{service_gid}' | |
AND dest_stop_times.departure_time > dep_stop_times.departure_time | |
AND trips.gid = dep_stop_times.trip_gid | |
AND trips.gid = dest_stop_times.trip_gid") |
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
group :test do | |
gem 'rspec' | |
gem "rspec-rails", ">= 2.0.0.beta.5" | |
gem 'cucumber' | |
gem 'capybara' | |
gem 'database_cleaner' | |
gem 'cucumber-rails' | |
end |
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
Feature: Completing the study | |
In order to complete the study | |
As a participant | |
I want to be able to go through the entire 9 month process | |
Scenario: From signup to completion | |
Given it is "April 5, 2010 10:00am" | |
And the following "admins" exist: | |
| login | role | |
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
http://shareurmeal.com/ | |
http://www.eonline.com/photos/gallery.jsp?galleryUUID=233#40658 | |
javascript:if(wdip==undefined){var%20wdip={"protocol":(("https:"==document.location.protocol)?"https://":"http://"),"domain":'wdi-production.heroku.com'};(function(){_my_script=document.createElement('SCRIPT');_my_script.type='text/javascript';_my_script.src=wdip.protocol+wdip.domain+'/widgets/image_picker/wdi_image_picker_widget.js';document.getElementsByTagName('head')[0].appendChild(_my_script);})();}else{wdip.refresh();} | |
https://requester.mturk.com/mturk/manageHITs |
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 Post < ActiveRecord::Base | |
houdini(:moderates_image, | |
:after => :create, | |
:if => Proc.new{ !!self.image } | |
:title => "Moderate image", | |
:form_html => Proc.new{ | |
haml_engine = Haml::Engine.new(RAILS_ROOT + '/app/views/posts/turk_template.html.haml') | |
question_html = haml_engine.render(Object.new, :image => self.image(:large).url) | |
}, | |
:callback => Proc.new{ |
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 Post < ActiveRecord::Base | |
include Houdini::Model | |
houdini :moderates_image, | |
:on => :after_create, | |
:if => :image_updated?, | |
:title => 'Review Image', | |
:form_html => :generate_houdini_html, | |
:callback => :houdini_callback | |
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
%h2 Should this image be flagged? | |
%img{:src => post.photo.url(:small)} | |
%input{:type => 'radio', :name => 'flagged', :value => 'yes'} Yes | |
%input{:type => 'radio', :name => 'flagged', :value => 'no'} No |
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
api_param :title, | |
:required => true, | |
:validates_length => (10..244), | |
:description => "Title of the work you want done. This will be shown to workers as they browse available tasks to complete." |
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
require 'faster_csv' | |
class FasterCSV | |
class Table | |
def remove_blank_columns | |
original_mode_method = "by_#{self.mode}!".to_sym | |
by_col!.delete_if{|header, values| header.blank?}.send(original_mode_method) | |
end | |
def remove_blank_rows |