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 ApplicationController < ActionController::Base | |
before_filter :ensure_http | |
def ensure_http | |
redirect_to 'http://' + request.host + request.request_uri if request.protocol == 'https://' | |
end | |
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
# This is all in cron.rake (I have the hourly cron add-on) | |
if Time.zone.now.hour == 0 | |
User.send_later(:send_daily_leaderboard_email) # do this once per day | |
if Time.zone.now.strftime("%w").to_i == 0 | |
ReportMailer.send_later(:deliver_manager_activity_report, 1.week.ago) # do this once per week | |
end | |
if Time.zone.now.strftime("%e").to_i == 1 |
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
attr_accessor :debtor_fb_id, :creditor_fb_id | |
before_validation :create_debtor_and_creditor | |
def create_debtor_and_creditor | |
self.debtor = User.find_or_create_by_fb_id(debtor_fb_id) if debtor_fb_id | |
self.creditor = User.find_or_create_by_fb_id(creditor_fb_id) if creditor_fb_id | |
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
def unordered_list(collection, options = {}) | |
output = %{<ul class="#{options.delete(:class).to_s}">} | |
collection.each do |item| | |
output += "<li>" + yield(item) + "</li>" | |
end | |
return output += "</ul>" | |
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
-----> Installing gem rmagick 2.12.2 from http://rubygems.org | |
Building native extensions. This could take a while... | |
ERROR: Error installing rmagick: | |
ERROR: Failed to build gem native extension. | |
/usr/local/bin/ruby extconf.rb | |
checking for Ruby version >= 1.8.5... yes | |
checking for gcc... yes | |
checking for Magick-config... yes | |
checking for ImageMagick version >= 6.3.5... 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
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
<html> | |
<head> | |
<title>Runtime Error</title> | |
<style> | |
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} | |
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} | |
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} | |
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } | |
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } | |
pre {font-family:"Lucida Console";font-size: .9em} |
NewerOlder