SQL Server Float Dates in Ruby

Yesterday, I ran into a situation doing integration with a security app of having to calculate a date to float for SQL Server. Dates as float in SQL Server are calculated from 01/01/1900 00:00:00 so here is the code I used:


  @date = (Time.now.to_f.ceil/86400) + 24105

Time.now.to_f.ceil will return the number of seconds at the end of the day since Epoch Time 01/01/1970. Diving by 8400 will convert that to days and adding 24105 will add the number of days since 01/01/1900.

So to get the time for SQL Server as a float for 30 days from now this is the exact code I used:


  @end_date = ((Time.now + 30.days).to_f.ceil / 86400) + 24105


Authorize.net Recurring Billing API Ruby Sample

After the news of Authorize.net Recurring Billing API yesterday. Today I also found some sample code for using in Ruby applications for integration into ARB.

You can get it at: http://developer.authorize.net/samplecode/


acts_as_geocode plugin released

I needed to retrieve geocodes from Google for a couple of new projects that are coming up so I sat down and made a plugin of it.

It takes an address, gets the lat and long from google and adds them to the database.

SVN Repository is here:

http://plugins.mosaicglobe.org/svn/trunk/acts_as_geocode/

All feedback is appreciated.


Globalize kicks butt

A couple of days ago, I needed to be able to have two different translations of a survey, English and Spanish. I remembered a while back reading about Globalize and decided to see if that would work. This guide is the one I used to get started.

After about an hour and a few migrations to put the english text into the spanish with [SPANISH] in front for testing it was working.

Awesome job guys.


Redirecting RSS to FeedBurner with Pound

I didn't see this anywhere on the web so I'll post the configuration here for PlanetRubyonRails and pound for redirecting to feedburner. You can skip the HeadRequire part if you are only hosting one app.

Service
    HeadRequire "Host:*.www.server_name.org.*"
    URL "/xml/atom"
    Redirect "http://feeds.feedburner.com/"
End
Service
    HeadRequire "Host:*.www.server_name.org.*"
    URL "/xml/rss"
    Redirect "http://feeds.feedburner.com/"
End


Planeta Rails

I just noticed on Artima Ruby Buzz that Victor put up a new railsplanet for Spanish speaking Rails developers at Planeta Rails.


New Planet Rails Members

I just added two new blogs to PlanetRubyOnRails. One is the Ruby on Rails Podcast, the other is Tourbus Developer Blog.


PlanetRubyonRails Updated to latest code

I updated the PlanetRubyOnRails site today in anticipation of a new release soon. I need to let the cron job run for a few days with a lot of feeds in a live setting to make sure there are no performance issues.

New stuff and bugs fixed:

  • Tags from categories and tags
  • Use guid instead of title for post searching of duplicates
  • Get entry author name for blogs with multiple authors.
  • Theme support
  • Convert settings to db, instead of old config file
  • Move to FeedTools

If all goes well this week, I'll probably try to do a release next weekend.


RailsPlanet updates soon

So, for the last few months I've been too busy to work on the Planet RubyOnRails code. We launched last week and that has freed up some time. So here's the list of upcoming stuff:

  • Crawler now based on FeedTools
  • Feed caching via FeedTools, cron job can now be run as often as you like and feeds are only retrieved if their ttl has expired
  • First Run account creation
  • Category/Tags support from feed categories
  • Theme support from the theme support plugin
  • Pages support with Textile markup like Typo
  • A whole slew of bugfixes, and HTML fixes
  • Working tests

I've been talking to Victor about adding some more stuff, like ping support, and configurable sidebar support, like Typo.


Powered by MosaicGlobe.