This file contains 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 unsubscribe | |
token = Base64.decode64(params[:token]) #using base64 encoding in the url to prevent unsubscribe abuse | |
@user = User.find_by_access_token(token) #find the user from the ID in url | |
@user.opt_out = true #change them to not get email | |
@user.save #save the changes | |
redirect_to "/", :notice => "We won't bug you with emails!" #give them a little notice that it worked | |
end | |
This file contains 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
en-GB: | |
date: | |
abbr_day_names: | |
- Sun | |
- Mon | |
- Tue | |
- Wed | |
- Thu | |
- Fri | |
- Sat |
This file contains 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
2012-07-28T17:05:43+00:00 app[web.1]: [2012-07-28 10:05:43] INFO WEBrick 1.3.1 | |
2012-07-28T17:05:43+00:00 app[web.1]: [2012-07-28 10:05:43] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] | |
2012-07-28T17:05:43+00:00 app[web.1]: [2012-07-28 10:05:43] INFO WEBrick::HTTPServer#start: pid=2 port=49545 | |
2012-07-28T17:05:44+00:00 heroku[web.1]: State changed from starting to up | |
2012-07-28T17:05:46+00:00 app[web.1]: => Booting WEBrick | |
2012-07-28T17:05:46+00:00 app[web.1]: => Rails 3.2.6 application starting in production on http://0.0.0.0:49545 | |
2012-07-28T17:05:46+00:00 app[web.1]: => Call with -d to detach | |
2012-07-28T17:05:46+00:00 app[web.1]: => Ctrl-C to shutdown server | |
2012-07-28T17:05:46+00:00 app[web.1]: | |
2012-07-28T17:05:46+00:00 app[web.1]: |
This file contains 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
Troys-MacBook-Pro:BackOffice troy$ b rake assets:precompile --trace | |
/Users/troy/.rvm/gems/ruby-1.9.3-p0@threetwo/gems/prawn-core-0.8.4/lib/prawn/core.rb:34: warning: already initialized constant VERSION | |
/Users/troy/.rvm/gems/ruby-1.9.3-p0@threetwo/gems/cloudprint-0.1.2/lib/cloudprint/connection.rb:5: warning: already initialized constant VERIFY_PEER | |
** Invoke assets:precompile (first_time) | |
** Execute assets:precompile | |
/Users/troy/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /Users/troy/.rvm/gems/ruby-1.9.3-p0@threetwo/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace | |
/Users/troy/.rvm/gems/ruby-1.9.3-p0@threetwo/gems/prawn-core-0.8.4/lib/prawn/core.rb:34: warning: already initialized constant VERSION | |
/Users/troy/.rvm/gems/ruby-1.9.3-p0@threetwo/gems/cloudprint-0.1.2/lib/cloudprint/connection.rb:5: warning: already initialized constant VERIFY_PEER | |
** Invoke assets:precompile:all (first_time) | |
** Execute assets:precompile:all |
This file contains 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
namespace :some_thingy do | |
task :my_big_fixer, [:production_run] => :environment do |t, args| | |
production_run = args[:production_run] == "true" | |
ap "doing a dry run" unless production_run | |
my_logger = Logger.new("#{Rails.root}/log/my_thingy.log") | |
require 'progress_bar' | |
bar = ProgressBar.new(User.all.count) # pass the total for the progress bar | |
my_logger.info "Starting at #{Time.now}" | |
This file contains 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
require 'sprockets/engines' | |
require 'sprockets/mime' | |
require 'sprockets/processor' | |
require 'sprockets/utils' | |
module Sprockets | |
# `Processing` is an internal mixin whose public methods are exposed on | |
# the `Environment` and `Index` classes. | |
module Processing | |
include Engines, Mime |
This file contains 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
if ad_records.count == 1 | |
ad_record = ad_records.first | |
ad = Ad.new( | |
:tagline => ad_record['tag_line'], | |
:service => service, | |
:image_url => ad_record['image_external_url'], | |
:citygrid_ad_id => ad_record['ad_id'] | |
) | |
ad.image = Image.new(:name => ad_record['image_external_url'], :role => "AD_IMAGE", :url => ad_record['image_external_url'], :format => ad_record['image_external_url'].to_s.split('.').last ) |
This file contains 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
####TO CREATE A BOOLEAN VIRTUAL ATTRIBUTE WITH VALIDATION: | |
##In the model: | |
class Person < ActiveRecord::Base | |
validates_acceptance_of :terms_of_service | |
#if using attr_accessible | |
attr_accessible :name, :etc, :terms_of_service | |
end |
This file contains 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
#we populated some @markets sort of like this; | |
# @results << OpenStruct.new(name: group[1].first.city.title, color: colors[index], data: [], city_id: group[0]) | |
# later.... each result.data << photos_that_day.to_i | |
json.chart do | |
json.type 'column' | |
json.backgroundColor 'rgba(255, 255, 255, 0.1)' | |
json.style do | |
json.fontFamily 'monospace' | |
json.color "#000" |
This file contains 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
en-NG: | |
date: | |
abbr_day_names: | |
- Sun | |
- Mon | |
- Tue | |
- Wed | |
- Thu | |
- Fri | |
- Sat |
OlderNewer