Skip to content

Instantly share code, notes, and snippets.

View edavis10's full-sized avatar

Eric Davis edavis10

View GitHub Profile
@edavis10
edavis10 / gist:13684
Created September 29, 2008 21:51 — forked from entp/gist:13681
<!-- for some reason this isn't receiving my style! -->
<pre class="tl-body viewsource"><%= foo.bar %></pre>
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
#!/usr/bin/env ruby
# Written by Coda Hale <[email protected]>. MIT License. Go for it.
def include_pattern(filename)
core = filename.gsub(/_spec/, "").gsub(/\Aspec\//, "")
return Regexp.quote(core)
end
if ARGV.empty? || ARGV == ["--help"] || ARGV == ["-h"]
STDERR.puts("Usage:")
@edavis10
edavis10 / gist:58866
Created February 5, 2009 17:48 — forked from rails/gist:58761
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
@edavis10
edavis10 / gist:59194
Created February 6, 2009 03:06 — forked from thewoolleyman/gist:47004
Example of CruiseControl.rb cruise_config.rb
#### Example of CruiseControl.rb cruise_config.rb which dynamically picks ####
#### the version of Rails to use based on CCRB project name ####
# cruise_config.rb:
require 'fileutils'
Project.configure do |project|
project.email_notifier.emails = ["chad+sandbox-ci-#{Socket.gethostname.chomp.downcase}@mycompany.com"]
require "#{File.dirname(__FILE__)}/vendor/plugins/shared_stuff/lib/cruise/mycompany_cruise_config.rb"
@edavis10
edavis10 / gist:59519
Created February 6, 2009 17:44 — forked from igal/gist:59510
### Mailer configuration from config/environments/production.rb
# Documnentation:
# * http://wiki.rubyonrails.com/rails/pages/HowToSendEmailsWithActionMailer
# * http://api.rubyonrails.org/classes/ActionMailer/Base.html
# Let MTA handle deliveries asynchronously, rather than using default synchronous SMTP
config.action_mailer.delivery_method = :sendmail
# Let MTA handle errors, do not raise exceptions
/*
* The MIT License
*
* Copyright (c) 2009 James F. Herdman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
#!/usr/bin/env ruby
#
# usage: script/server_restarter
#
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+
# is so fast when completely reloading the server, I wrote this script to listen to the
# given directories, and kill/restart the server when any file is changed.
#
# It's quick, simple, and it reliably reloads your application when changes are made.
#
task :integrity => ['config/database.yml', 'test']
file 'config/database.yml' do
cp 'config/database.yml.sample', 'config/database.yml'
end
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index cba8e59..af53ec2 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -139,6 +139,7 @@ class IssuesController < ApplicationController
if request.get? || request.xhr?
@issue.start_date ||= Date.today
+ @issue.inspire_on(params[:inspire_on]) if params[:inspire_on]
else