Skip to content

Instantly share code, notes, and snippets.

View RogerPodacter's full-sized avatar
🎯
Focusing

Tom Lehman RogerPodacter

🎯
Focusing
View GitHub Profile
<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}
<?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
-----> 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
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
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
@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
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 / heroku_bundler_downloader.rb
Created February 16, 2011 17:45
Heroku Bundler Downloader
app_name = "YOUR_APP_NAME"
bundles = `heroku bundles`.split("\n")
bundles.select{|i| i.match(/\d{4}-\d{2}-\d{2}\s+c/)}.each do |bundle|
name = bundle.split.first
puts "downloading #{name}"
system("heroku bundles:download #{name}")
system("mv #{app_name}.tar.gz #{name}-rapgenius.tar.gz")
puts "done!\n\n"
end
s.gsub(/^.{1,5}$/, '').gsub(/^[ ~-]+$/, '').gsub(/^[^a-zA-Z]+$/, '').gsub(/^\s*INSIDE THE THIRD REICH\s*$/, '').rg_markdown_to_html.to_file("third.html")
dj empirical 12904232502097772955
billtron 11960633949492023380
Sawyer Carter Jacobs 02606413893553028032
Evan Carmouche 15932439420494476147
Kate Burns 17535307611545811967