This file contains hidden or 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 dates_this_year | |
first_day = @ctl_config.smc_connection.select_value("select min(created_at) from coupons") | |
first_day = first_day.nil? ? Date.today : Date.parse(first_day) | |
first_day = Date.new(first_day.year.to_i) | |
last_day = Date.new(Date.today.year + 1) - 1 | |
dates = [] | |
first_day.upto(last_day) do |day| | |
dates << { | |
:day_of_year => day.yday, |
This file contains hidden or 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
# in ApplicationController | |
def admin_nav | |
return unless current_user | |
@sec_nav = [] | |
@current_main = "Admin" | |
@sec_nav << {:name => "Users", :link => users_path} if admin? | |
@sec_nav << {:name => "Invites", :link => invites_path} if admin? | |
end |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<table class="table" id="todo_list"> | |
<tbody> | |
<tr> | |
<th> |
This file contains hidden or 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
... # building up the user, post and topic objects | |
assert_difference('Delayed::Job.count') do | |
user.send_forum_notification(:post => post, :topic => topic) | |
end | |
assert_emails 1 do | |
Delayed::Worker.new.work_off | |
end | |
notification_email = ActionMailer::Base.deliveries.first | |
This file contains hidden or 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 process_for_social_media | |
if profile | |
profile.profile_social_networks.each do |network| | |
if network.activated? | |
if network.twitter? | |
process_for_twitter(network.twitter_login, network.id) | |
end | |
if network.facebook? | |
send_to_facebook(network) |
This file contains hidden or 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
MartyMPB2:other marty$ rvm --trace --default 1.8.7-p249 | |
--trace --default 1.8.7-p249 | |
rvm 0.1.39 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/] | |
+ [[ -z '' ]] | |
+ [[ ! -z ruby-1.8.7-p174 ]] | |
+ rvm_action=use | |
+ [[ ! -z '' ]] | |
+ [[ ! -z '' ]] |
This file contains hidden or 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
MartyMPB2:~ marty$ cat /Users/marty/.rvm/environments/default | |
export PATH="/Users/marty/.rvm/gems/ruby-1.8.7-p249/bin:/Users/marty/.rvm/gems/ruby-1.8.7-p249@global/bin:/Users/marty/.rvm/rubies/ruby-1.8.7-p249/bin:/Users/marty/.rvm/bin:$PATH" | |
export RUBY_VERSION='ruby-1.8.7-p249' | |
export GEM_HOME='/Users/marty/.rvm/gems/ruby-1.8.7-p249' | |
export GEM_PATH='/Users/marty/.rvm/gems/ruby-1.8.7-p249:/Users/marty/.rvm/gems/ruby-1.8.7-p249@global' | |
export BUNDLE_PATH='/Users/marty/.rvm/gems/ruby-1.8.7-p249' | |
export MY_RUBY_HOME='/Users/marty/.rvm/rubies/ruby-1.8.7-p249' | |
export IRBRC='/Users/marty/.rvm/rubies/ruby-1.8.7-p249/.irbrc' | |
export rvm_ruby_string='ruby-1.8.7-p249' | |
unset rvm_gemset_name |
This file contains hidden or 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
MartyMPBS:smeagol marty$ rake smeagol:install | |
(in /Users/marty/projects/smeagol) | |
INFO: Setting the run_list to ["homebrew", "homebrew::dbs", "homebrew::misc", "git", "ruby", "ruby::irbrc", "python", "erlang", "node", "oh-my-zsh", "atmos.vim"] from JSON | |
INFO: Starting Chef Run | |
ERROR: Running exception handlers | |
ERROR: Exception handlers complete | |
ERROR: Re-raising exception: RuntimeError - No Full Name set for your ~/.gitconfig | |
/Users/marty/projects/smeagol/cookbooks/git/recipes/default.rb:21:in `from_file' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/mixin/recipe_definition_dsl_core.rb:71:in `instance_eval' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/mixin/recipe_definition_dsl_core.rb:71:in `method_missing' |
This file contains hidden or 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
INFO: Writing updated content for template[/Users/marty/.gitconfig] to /Users/marty/.gitconfig | |
INFO: Backing up template[/Users/marty/.gitconfig] to /var/chef/backup/Users/marty/.gitconfig.chef-20100802103334 | |
ERROR: template[/Users/marty/.gitconfig] (/Users/marty/projects/smeagol/cookbooks/git/recipes/default.rb:9:in `from_file') had an error: | |
Operation not permitted - /var/folders/YG/YG6o4QpZGmuwo6-smrQQY++++TI/-Tmp-/chef-rendered-template20100802-3327-6i4756-0 | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/file_access_control.rb:109:in `chown' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/file_access_control.rb:109:in `set_group' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/file_access_control.rb:55:in `set_all' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/provider/template.rb:97:in `set_all_access_controls' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/provider/template.rb:54:in `ac |
This file contains hidden or 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
INFO: Writing updated content for template[/Users/marty/.gitconfig] to /Users/marty/.gitconfig | |
INFO: Backing up template[/Users/marty/.gitconfig] to /var/folders/YG/YG6o4QpZGmuwo6-smrQQY++++TI/-Tmp-/smeagol/backup/Users/marty/.gitconfig.chef-20100802104711 | |
ERROR: template[/Users/marty/.gitconfig] (/Users/marty/projects/smeagol/cookbooks/git/recipes/default.rb:9:in `from_file') had an error: | |
Operation not permitted - /var/folders/YG/YG6o4QpZGmuwo6-smrQQY++++TI/-Tmp-/chef-rendered-template20100802-5001-b978qe-0 | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/file_access_control.rb:109:in `chown' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/file_access_control.rb:109:in `set_group' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/file_access_control.rb:55:in `set_all' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9.6/bin/../lib/chef/provider/template.rb:97:in `set_all_access_controls' | |
/Users/marty/.rvm/gems/ruby-1.8.7-p174/gems/chef-0.9. |
OlderNewer