Wednesday, May 27, 2009

MoreMoney. A library to manage money

MoreMoney allows you to handle money without having to use a float/decimal field to store the amount in the database.

MoreMoney is a fork of the original Money gem written by Tobias Luetke

The original project can be found at: http://rubyforge.org/projects/money/

Main differences from the original gem are the capability to manage the nil value, an increased flexibility in formatting and the support for any currency

Usage example:
require 'more_money'

#add the US dollar currency
MoreMoney::Money.add_currency({:code => 'USD', :symbol => '$', :description => 'us_dollar'})

#add the british pound
MoreMoney::Money.add_currency({:code => 'GBP', :symbol => '£', :description => 'gb_pound'})

#now is possible to instantiate some objects
ten_pounds = MoreMoney::Money.gp_pound(1000)
ten_bucks = MoreMoney::Money.us_dollar(1000)

ten_pounds.format
=> "£ 10.00"

ten_bucks.format
=> "$ 10.00"

http://moremoney.rubyforge.org/docs

Monday, May 25, 2009

Firefinder for Firebug 0.91

https://addons.mozilla.org/en-US/firefox/images/p/32291/1242090914

The idea is to quickly text CSS selectors/XPath in a document to see what will match, or how many instances of a certain element there are (thinking certain type of heading, for instance).

It offers:

  • A quick way to filter HTML elements via CSS selector(s) or XPath
  • Highlight them in the document
  • List them in the Firebug panel in a collapsable list
  • A count of the total matching number of elements
http://ajaxian.com/archives/firefinder-quick-access-to-what-you-are-looking-for
https://addons.mozilla.org/en-US/firefox/addon/11905

Sunspot

Pure-Ruby Solr Search and Indexing

All the power of the Solr search engine; all the beauty of Ruby. Sunspot exposes all of Solr's most powerful search features using an API of elegant DSLs. That means robust, flexible fulltext search with no boolean queries and no string programming.

Use it with Rails.

Sunspot::Rails hooks Sunspot into Rails with drop-in ease, extending ActiveRecord objects for searchability and managing the commit cycle transparently. Get Solr search in your Rails app in five minutes.

Get all this

  • Define searchable fields in an intuitive DSL, either indexing data directly from attributes or defining virtual attributes for search-specific information.
  • Use Sunspot's search DSL to restrict results using all the usual logical operators, negate them, or exclude individual objects from the results.
  • Index subclasses, search for superclasses: Sunspot stores the entire class hierarchy for each object that's indexed.
  • Use field facets for powerful drill-down search.
  • If you've got WillPaginate installed, use it seamlessly with Sunspot's search results.
http://agilewebdevelopment.com/plugins/sunspot_rails
http://outoftime.github.com/sunspot/

Sunday, May 24, 2009

Receiving emails and attachments with Rails

Does your Rails app need to handle incoming emails with the attachments? All of the examples I’ve seen so far show you how to insert email attachments into the DB. Here’s a quick example that uses RailsCron to poll a POP3 account every minute for new emails and stores the attachments on the filesystem. If you need help using or running RailsCron see my previous posts about the topic.

The Agile book has a good example that kicks off a runner script but I think this method is far more efficient than having your mail system kick off a separate runner every time a new email is received, especially if you’re dealing in high volume.

It also handles non-responsive or slow responding POP3 servers by setting a high timeout length and retrying a handful of times before it gives up.

http://naffis.com/2006/8/14/receiving-emails-and-attachments-with-rails

Axiis

Axiis has been designed to be a concise, expressive, and modular framework that let developers and designers create compelling data visualization solutions by assembling easy to understand building blocks into simple or complex visual representations of data.

Axiis takes a very visual approach to development in both the markup language itself as well as the concepts used to create data visualizations.

The two primary concepts to understand in Axiis are Geometry and Layout.

Geometry: All data visualizations are ultimately represented as one or more sets of simple or complex geometries that plot specific data points relative to visual coordinates. To that end, Axiis leverages the Degrafa framework to describe its geometries.

Layout: The Axiis layout classes are the heart of the framework, as they allow the developer to describe in simple terms how they want to translate sets of data into geometric representations. The layout classes allow developers to use and combine pre-built layout schemes as well as build their own to create anything from standard cartesian charts to wild yet-to-be imagined data visualizations.

http://code.google.com/p/axiis
http://www.axiis.org

Wednesday, May 20, 2009

EcmaScript 5: Changes to JavaScript

Three Googlers, Mark Miller, Waldemar Horwat, and Mike Samuel gave the talk above to discuss how JavaScript is changing, and gets into detail on EcmaScript 5.

http://ajaxian.com/archives/ecmascript-5-changes-to-javascript

Tuesday, May 19, 2009

Rails 3

Rails 3 is going to be a big release. Lots of people (including myself) will be explaining Rails 3 updates & features. This page contains a comprehensive, up-to-date list of rails tutorials, screencasts, video talks, articles & training courses relating to Rails 3.

Learning Rails 3
http://railsnotes.com/rails-3