Your SlideShare is downloading. ×
0
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
smusher has_a_location acts_as_feed
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

smusher has_a_location acts_as_feed

586

Published 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

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

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

×