Skip to content

Instantly share code, notes, and snippets.

View edavis10's full-sized avatar

Eric Davis edavis10

View GitHub Profile
@edavis10
edavis10 / x_startup.sh
Created April 15, 2009 23:26
Script I run to start up apps once Xorg logs me in
#!/bin/bash
#### Startup some of my things
### DISPLAY 0.0 is my left monitor group
### DISPLAY 0.1 is my riight monitor group
# Wrapper script to startup iceweasel/firefox using my default profile
DISPLAY=":0.0" iceweasel-default.sh &
DISPLAY=":0.0" icedove &
DISPLAY=":0.0" epiphany http://tracks http://pandora.com &
DISPLAY=":0.0" emacs.sh ~/tmp/scratch.txt &
##################################################
# Factory girl
##################################################
# Redmine specific Factories
Factory.define :user do |u|
u.mail { Faker::Internet.email }
u.firstname { Faker::Name.first_name }
u.lastname { Faker::Name.last_name }
u.login { Faker::Internet.user_name }
@edavis10
edavis10 / demo.rake
Created April 4, 2009 00:33
Rake tasks to create tons of data for Redmine
# Still a work in progress but is good enough for development
#
# `rake redmine:demo_data` for it all
# `rake redmine:demo_data:users`
# `rake redmine:demo_data:projects`
# `rake redmine:demo_data:issues`
# `rake redmine:demo_data:time_entries`
require 'faker'
require 'random_data'
production:
delivery_method: :smtp
smtp_settings:
address: localhost
port: 25
domain: example.com
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
echo -e "This is a summary of disk usage on your server:\n\n `df -h`\n\nUptime: `uptime`" | mail -s "System report for `hostname` on `date`" my_email@gmail.\com
@edavis10
edavis10 / integrity_apache.conf
Created February 27, 2009 23:47
Apache2 / Passenger configuration for integrity
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6
PassengerRuby /usr/local/bin/ruby
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /home/edavis/integrity/public
<Directory /home/edavis/integrity/public">
task :integrity => ['config/database.yml', 'test']
file 'config/database.yml' do
cp 'config/database.yml.sample', 'config/database.yml'
end
#!/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.
#
# Add some alias'es to FillingRequest map the attributes directly
def legal_business_name
self.company
end
def legal_business_name=(v)
self.company = v
end
def phone_number