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 :readmill_client_id, "xxx" | |
set :readmill_client_secret, "xxx" | |
get '/auth' do | |
callback = "http://myapp.com/callback" | |
redirect "https://readmill.com/oauth/authorize?response_type=code&client_id=#{settings.readmill_client_id}&redirect_uri=#{callback}&scope=non-expiring" | |
end | |
get '/callback' do |
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
get '/auth/readmill' do | |
redirect "http://readmill.com/oauth/authorize?response_type=code&client_id=#{settings.readmill_client_id}&redirect_uri=#{settings.readmill_redirect}&scope=non-expiring" | |
end | |
get '/callback/readmill' do | |
token_params = { | |
:grant_type => 'authorization_code', | |
:client_id => settings.readmill_client_id, | |
:client_secret => settings.readmill_client_secret, | |
:redirect_uri => settings.readmill_redirect, |
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
get '/travis/:id/status' do |id| | |
token = "token!!" | |
http = Net::HTTP.new('magnum.travis-ci.com', 443) | |
http.use_ssl = true | |
path = "/Readmill/#{id}.png?token=#{token}" | |
response = http.head(path, nil) | |
if response['Content-Disposition'].include?('failing') | |
@message = "The build failed." |
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
aavunction(window) { | |
var WIDGET_BASE_DOMAIN = 'https://widgets.readmill.com', | |
PLATFORM_BASE_DOMAIN = 'https://platform.readmill.com', | |
hasAutoTriggerProcessMarkersFired = false, doc = window.document; | |
/* | |
* Select most suitable method for getting all elements by tag name | |
* to support browsers that does not have getElementsByClassName | |
*/ | |
function getElementsByClassName(clsName) { |
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
Capistrano::Configuration.instance(:must_exist).load do | |
require 'httparty' | |
before "deploy", "yammer:notify_deploy_start" | |
after "deploy", "yammer:notify_deploy_success" | |
after "deploy:rollback", "yammer:notify_deploy_fail" | |
namespace :yammer do | |
desc "Notify a Yammer account that a deploy just started" | |
task :notify_deploy_start do |
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
desc 'Work email queue' | |
task :emails => :environment do | |
`if [ ! -d "pids" ]; then mkdir pids; fi; echo "#{Process.pid}" > #{Rails.root}/pids/emails.pid` | |
Minion.job "emails" do |args| | |
logger.info "[#{Time.now}] Recieved queued item" | |
begin | |
UserMailer.deliver(args) | |
rescue Exception => exception | |
logger.info "Error, #{exception}" | |
raise exception |
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
Before: | |
new_user_registration GET /signup(.:format) {:action=>"new", :controller=>"invited_registrations"} | |
user_registration POST /signup(.:format) {:action=>"create", :controller=>"invited_registrations"} | |
complete_signup GET /signup/complete(.:format) {:action=>"new", :controller=>"registrations"} | |
complete_signup POST /signup/complete(.:format) {:action=>"create", :controller=>"registrations"} | |
After: |