smusher has_a_location acts_as_feed
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

smusher has_a_location acts_as_feed

  • 1,071 views
Uploaded on

Short presentation over my new plkgins acts_as_feed + has_a_locaion and the smusher libary for lossless image reduction

Short presentation over my new plkgins acts_as_feed + has_a_locaion and the smusher libary for lossless image reduction

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,071
On Slideshare
1,071
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Misc topics
  • 2. Hello my name is
    • Michael Grosser
    • TU-Dresden / TFH-Berlin
    • Rathershort.com
  • 3. Topics
    • Smusher
    • has_a_location
    • acts_as_feed
  • 4. Smusher
  • 5. Smusher: Formats
    • GIF -> kleine PNG
    • PNG -> kleine PNG
    • JPG -> kleine JPG
  • 6. Smusher: Diff
    • 2898 bytes
    • 138 bytes
    • Typically 10-95%
  • 7. Smusher: Usage
    • git clone git://github.com/grosser/smusher.git
    • cd smusher
    • rake URL=www.x.com/logo.png FILE=public/logo.png
    • rake URL=www.x.com/images FOLDER=/my_app/public/images
    • Protection: 404 / file larger / file empty
  • 8. has_a_location
  • 9. has_a_location: Setup
    • script/plugin install git://github.com/ptb/geokit.git
    • ... git://github.com/grosser/has_a_location.git
    • has_a_location :default_units=>:kms, :default_formula => :flat, :default_location_lat => CFG[:default_lat], :default_location_lng => CFG[:default_lng]
  • 10. has_a_location: Usage
    • @festival.in_radius(500)
    • @festival.location = [12.1212,23.232232]
    • @festival = [0,0] #does not save default
    • do_stuff if @festival.location
  • 11. acts_as_feed
  • 12. acts_as_feed
    • Users/Companies blogs
    • Transparent - Atom + RSS
    • URL changes -> update
    • Old -> Update
    • Protect: hanging downloads
    • Protect: giant files
  • 13. acts_as_feed: Setup
    • sudo gem install rss-client
    • script/plugin install git://github.com/grosser/acts_as_feed.git
    • class Feed < ActiveRecord::Base acts_as_feed :timeout=>3 #seconds belongs_to :covered, :polymorphic => true after_save :update_feed end
  • 14. acts_as_feed: Usage
    • data = YAML.load(feed.feed_data)
    • feed_title = data[:title]
    • feed_descr = data[:descriptions]
    • first_entry_title = data[:entries][0][:title]
  • 15. Ende
    • Danke