January 23, 2012 by Dave

For those of you Linux users using Gnome, KDE, or Unity, here's a desktop entry file that you can use to create a shortcut/launcher icon to Aptana Studio 3. Just add this to /usr/share/applications or ~/.local/share/applications.

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Aptana Studio 3
Comment=The professional, open source development tool for the open web
Icon=/opt/aptana-studio-3/icon.xpm
GenericName=Aptana Studio
Type=Application
Exec=/opt/aptana-studio-3/AptanaStudio3
MimeType=text/plain;
Categories=Development;IDE;

This assumes you've installed Aptana to /opt/aptana-studio-3, so if yours is in a different directory, be sure to change it.

Kudos

Credit goes to Willington Vega for supplying the original desktop entry file. 


0 Comments


December 20, 2011 by Dave

We recently created a new ruby gem called fletcher. It's a cross- website product/item information fetcher. To use fletcher, all you have to do it pass it a url to a product on one of favorite websites. You'll get back an easy-to-use ActiveRecord-like object(a Hashie::Mash) that contains useful information about that product, including its name, description, images, etc. Let's see it in action.

item = Fletcher.fetch

item.name # => "Avenir Deluxe Unicycle (20-Inch Wheel)"

item.description # => "A wonderful unicycle"

item.image # => {:url => "http://ecx.images-amazon.com/images/I/41b3TNb3uCL._SL500_AA300_.jpg", :alt => "Picture of 
Unicycle"}

item.image.url # => "http://ecx.images-amazon.com/images/I/41b3TNb3uCL._SL500_AA300_.jpg"

We originally wrote fletcher for use in our wishlist-sharing website, WishlistFactory, so you would only need to enter the url of a gift you want, and the gift information would automatically be fetched and included on your wishlist. We thought other people might find this useful, so we packaged it up as a gem and released it to the public.

The source code of fletcher is also on github, so if you'd like to add a supported website to fletcher, or make any other changes, feel free to fork it!

0 Comments
Tags:


September 15, 2011 by Dave

OmniAuth is a great gem for OAuth authentication in any rack application such as Ruby on Rails, Sinatra, etc. If you're using it in Rails, I wrote a handy little initializer that will automatically load in your OAuth provider credentials from a yaml config file instead of defining them directly in the initialzer.

# config/providers.yml
providers:
  google:
    key: CONSUMER_KEY
    secret: CONSUMER_SECRET 
  facebook:
    key: APP_ID
    secret: APP_SECRET
  twitter:
    key: CONSUMER_KEY
    secret: CONSUMER_SECRET

# config/initializers/omniauth.rb
if Rails.env != 'test'  
  config = YAML::load(File.open(Rails.root.join, "config", "providers.yml")))
  if config && !config.empty?
    Rails.application.config.middleware.use OmniAuth::Builder do        
      config["providers"].each do |name, credentials|
        provider name.to_sym, credentials["key"], credentials["secret"], {:client_options => config[:client_options]}       
      end
    end
  end
end

This makes it easy to add/delete providers by editing the providers.yml config file.

0 Comments