No attitude

Have you ever said yes to something, only to dread the obligation when it comes due? I have, many-many times. I recently read a blog post by Seth Godin on saying “no.” Here are his thoughts (republished with permission):

Seth Godin: On saying “no”
– If you’re not proud of it, don’t serve it.
– If you can’t do a good job, don’t take it on.
– If it’s going to distract you from the work that truly matters, pass.
– If you don’t know why they want you to do this, ask.
– If you need to hide it from your mom, reconsider.
– If it benefits you but not the people you care about, decline.
– If you’re going along with the crowd, that’s not enough.
– If it creates a habit that costs you in the long run, don’t start.
– If it doesn’t move you forward, hesitate then walk away.

Thanks, Seth. I’ll respectfully add a couple of my own to your list:
– If you’re going to say no, do it now. “Maybe” is not fair to the asker.
– If you’re saying yes out of fear of offending the asker, say no, you’ll grow stronger.
– If you’re unsure, sleep on it, then say no in the morning.

 

Copy and pasted from:

The Journal, a monthly newsletter from Kevin Rose.

CarrierWave file exists?

If you ever wondered how to check for file if exist while you were using carrierwave gem with storage on amazon S3 here is how.

Assuming you have User class:

class User < ActiveRecord::Base
  mount_uploader :avatar, AvatarUploader
end

and uploader class
class AvatarUploader < CarrierWave::Uploader::Base
  storage :fog
end

then only thing that you have to do is this

user = User.first
user.avatar.file.exists?

thats it. I kind of assumed that it should be simple avatar.exist? but you have to get fog instance of file to be able to access exists? method.