Skip to content

Instantly share code, notes, and snippets.

View RogerPodacter's full-sized avatar
🎯
Focusing

Tom Lehman RogerPodacter

🎯
Focusing
View GitHub Profile
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
@RogerPodacter
RogerPodacter / cron.rake
Created November 28, 2010 17:42
cron.rake
# 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
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
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
-----> 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
<?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
<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}