def self.generate_csv(fields, records, options = {})
CSV.generate(options) do |csv|
csv << fields.collect(&:humanize)
records.each do |record|
csv << record.attributes.values_at(*fields)
end
end
end
rbenv is trying to be more, specific, as to what it does and not interfere with other existing software. (Apparently RVM rewrites functions like 'cd').
Yeah, after seeing DHH's example I had some fun spending a few minutes making a little "plugin" for that[1].
We already use the as option[2] in our code though so I haven't had the chance to really work on that yet.
if Rails.env.to_s == "production"
Stripe.api_key = ENV['STRIPE_TOKEN']
else
Stripe.api_key = "public test key"
end
@tybro0103 mentioned you only need secure it when you're doing open source code. However I personally don't want my fellow developers to be able to refund payments, cancel my customers, or charge my customers copious amounts. Keep it secret, keep it safe.
I'm using Stripe to put together a SaaS application. We create a customer (Stripe) and link it to the user (our app). We handle the upgrading, trials, and charging. Just charge expiring customers in our crontab.
Stripe::Charge.create(
:amount => 1500, # $15.00 this time
:currency => "usd",
:customer => current_user.stripe_customer_token
)
As a web developer, I know some clients love cutting corners and don't secure things like they should. I mean, look at Sony and their recent PSN issues. So I only checkout from PayPal except on sites like Amazon. I've never heard of PayPal servers getting hacked.
Well there is has_secure_password, not an engine, but does most of the repeatable code. Generally the way I want my controllers and views to behave is dependent on the application. Also it adds more overhead and technical debt to the development and probably won't stack up against OmniAuth or Devise. (Haven't used others)
a lot of people want people to register to see content, that way they can send mass e-mails, say that have x users, etc. If you want to have manual activation it's not that hard, just add an extra field such as add_column :users, :activated, :boolean, :default => false, :null => false and then have an admin panel and set user.activated = true on your users.
I remember that I've done something similar before but used flash.now.success and got an error that success was undefined, is it only selected names or was it something else I did wrong? (It was so long ago and it's a pain to create a controller to test them XD)
I've been doing this forever so I kind of feel like it's a waste, but hopefully people that don't use gravatar will now be convinced to use or or introduced to it.
No, it's calling those methods on the request object (the one that has request.path, request.remote_ip, etc).
generate_csv([:id, :username], members, options[:csv])
Agreed. I hear so much about Chef and want to use it, but can't find any good resources.
Take a look at what rbenv doesn't do in comparison to RVM in the Readme: https://github.com/sstephenson/rbenv
rbenv is trying to be more, specific, as to what it does and not interfere with other existing software. (Apparently RVM rewrites functions like 'cd').
Yeah, after seeing DHH's example I had some fun spending a few minutes making a little "plugin" for that[1].
We already use the as option[2] in our code though so I haven't had the chance to really work on that yet.
[1] = https://gist.github.com/2014589
[2] = http://guides.rubyonrails.org/security.html#countermeasures
Generally you use Capistrano to copy it over. For Heroku you would use their config variables: http://devcenter.heroku.com/articles/config-vars
heroku config:add STRIPE_TOKEN=123
@tybro0103 mentioned you only need secure it when you're doing open source code. However I personally don't want my fellow developers to be able to refund payments, cancel my customers, or charge my customers copious amounts. Keep it secret, keep it safe.
I'm using Stripe to put together a SaaS application. We create a customer (Stripe) and link it to the user (our app). We handle the upgrading, trials, and charging. Just charge expiring customers in our crontab.
+1 for testing and +1 for future episodes on PayPal recurring subscriptions!
As a web developer, I know some clients love cutting corners and don't secure things like they should. I mean, look at Sony and their recent PSN issues. So I only checkout from PayPal except on sites like Amazon. I've never heard of PayPal servers getting hacked.
Based on the source code for this episode (I have yet to watch it), you made a typo, should read:
auth = env['omniauth.identity']
Well there is
has_secure_password
, not an engine, but does most of the repeatable code. Generally the way I want my controllers and views to behave is dependent on the application. Also it adds more overhead and technical debt to the development and probably won't stack up against OmniAuth or Devise. (Haven't used others)For the sake of the future.
http://wiki.macromates.com/Troubleshooting/EditInTextMate
did you run
rake db:migrate
?How come you didn't do something like this? Was there any reason?
the way BCrypt is, is really cool. Here is a password_digest:
$2a$10$QIFk4ytMIzE03/njtSMFmedzhTyv8DVMMtWjqnFeW9FcQpBEf.u0.
I believe 2a or $2a is the salt, $10 means 10 encryptions/stretches and the rest after the next $ (or included) is the resultant hash.
I don't like them since they take longer, sure it's by uncountable times, but it's really not too much for me to add the extra code. Also I do this:
a lot of people want people to register to see content, that way they can send mass e-mails, say that have x users, etc. If you want to have manual activation it's not that hard, just add an extra field such as
add_column :users, :activated, :boolean, :default => false, :null => false
and then have an admin panel and set user.activated = true on your users.I remember that I've done something similar before but used
flash.now.success
and got an error that success was undefined, is it only selected names or was it something else I did wrong? (It was so long ago and it's a pain to create a controller to test them XD)*has_secure_password ;P
Yeah, I don't know why they aren't accepting pull requests that allow you to rename what column it goes into.
I've been doing this forever so I kind of feel like it's a waste, but hopefully people that don't use gravatar will now be convinced to use or or introduced to it.