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

59 Resources For First Time Entrepreneurs

As a first time entrepreneur you probably have tons of questions. And every time you do a Google search for an answer you are bombarded with too much information and in some cases that information contradicts other things you have heard.

Legal & Accounting

Legal and accounting issues may not seem important when you are starting your company, but they are. Legal and accounting mistakes that you make early on can haunt you for years and can be expensive to fix. So if you are going to start a company you should do things right from the get go.

  • S Corp. vs. LLC: Which Structure is Right for Your Business - Determining the type of legal structure for a new business can be daunting for entrepreneurs and small business owners. Learn more about S Corporations and Limited Liability Companies (LLC), and decide if one of these business structures is right for you.
  • Legal Zoom – a cheap way to get incorporated.
  • Findlaw – a directory of all the lawyers throughout the US.
  • Bookkeeping 101: Debits and Credits - Accounting ends with score keeping but begins with record keeping. The first task of accounting is to accurately record transactions. Transactions are events that change the composition of a firm’s assets, liabilities, and equity.
  • Accounting Basics - This explanation of accounting basics will introduce you to some basic accounting principles, accounting concepts, and accounting terminology.
  • Docstoc – A free place to get legal documents and templates which can drastically help reduce your legal fees and in some cases allow you to do some legal stuff yourself.
  • You’ve Been Sued: What Do You Do? - Everything you wanted to know about being sued.
  • Opening a Business Bank Account – Business bank accounts and your identity.
  • Closing Down Your Business Permanently - If you’re shuttering your business for good, there’s more to it than drawing the blinds.
  • Legal Issues to Consider When Starting Your Business - There are a multitude of legal issues to think about when it comes to starting your business. Everything from your business name to its structure to its operation has legal implications.

Web Design

Design is something we tend to take for granted. Not only is important for your website to look good, but you also want to make sure it is usable and converts.

Internet Marketing

You can have a great product or service, but if no one sees it you will never make any money. Now this doesn’t mean you have to hire a marketing firm to help you out, but you could learn some basic things about Internet marketing.

Hiring Employees

When you don’t have much cash in the bank, you can’t afford to make hiring mistakes. Sooner or later you are going to have to hire a few employees, so you better know what to look for.

Raising Venture Capital

Raising money can be a pain in the ass, especially if you have never done it before. If you want to raise money, you need to know the basic terminology that venture capitalists use, how to create a pitching deck, and how to get in front of venture capitalists.

  • Vfinance - A directory of venture capitalists, angel investors, and business plan templates.
  • Forbes Midas List - A list of the top 100 venture capitalists for the year 2009.
  • The 10/20/30 Rule of PowerPoint - Before you make a powerpoint that showcases your company and how much money you are raising, you should read this.
  • How to Raise Venture Capital - An detailed overview on how you can raise money.
  • Venture Hacks - A blog for entrepreneurs that discusses everything about venture capital.
  • The Funded - An online community of entrepreneurs to research, rate, and review funding sources worldwide.
  • How To Raise Venture Dollars - Ben Elowitz who has raised over 40 million dollars breaks down the tricks to raising money.
  • Paul Graham - Awesome essays about venture capital and entrepreneurship.

General Business Advice

Other entrepreneurs have already solved many of the problems you are going to face. So when you run to into these generic problems, here are some websites you can turn to.

Living The Frugal Life

Although it may sound sexy to be an entrepreneur, most entrepreneurs don’t make a ton of money. You are going to have to learn to live a frugal life so that you can continue to do what you love and not worry about paying your mortgage.

http://www.quicksprout.com/2009/05/10/the-internet-entrepreneurs-handbook-%E2%80%93-54-resources-for-first-time-entrepreneurs

infinite_page

Installation

Instructions

Infinite Page is used exactly like wil_paginate plugin but make sure of the following:

  • Obviously infinite_page helper method should be used instead of will_paginate
  • Infinite page parts (each part is one page in classic pagination) should be placed in a partial
  • infinite_page call should be included in this partial
  • in your controller,
    • XHR request: render only this partial
    • other requests: render whole page

Parameters

infinite_page take two parameters :

  • +collection = nil+:: a WillPaginate:Collection return by paginate function
  • +options = {}+:: see Options paragraph

Options

Most will_paginate and remote_function options are available along with infinite_page’s 2 additional options. will_paginate options are used for classic pagination rendered inside <noscript> tag. remote_function options are used for next page XHR loading. The most important option is +:update+. It indicates the DOM element ID that contains the partial. :url and :render options are automatically set by infinite_page. Please refer to will_paginate and remote_function references.

live demo : http://ror.zarlboro.com
sources : http://github.com/Ouziel/infinite_page_demo

Add jQuery datagrids to your Rails applications

The jQuery grid plugin is an amazing Javascript project providing multi-functions Ajax datagrids for your web applications. With the 2dcJqgrid Rails plugin, you can now add these datagrids to your Ruby on Rails applications with just a few lines of code.

If you don't like the look & feel of this demo, you can easily customize it using jQuery themes.

Communications between your grids and the server will use the JSON format to exchange data.

The source code of this demo application is available on GitHub.

This solution is compatible with most of web browsers (even Internet Explorer 6 !!)

http://www.2dconcept.com/jquery-grid-rails-plugin

ExtJS on Rails

http://www.extjswithrails.com
http://extonrails.com

Tuesday, May 12, 2009

ProColor

ProColor is a simple, flexible, easy-to-use color-picker for the Prototype Javascript framework. ProColor is designed to be friendly to artists and programmers both. This user's manual both documents ProColor and demonstrates it in action.

ProColor is compatible with IE6+, Firefox 2+, Safari 3+, Opera 9+, and Chrome. It is not compatible with very old browsers, but it does at least fall back to a simple text-edit field for old browsers. It runs very well on Safari and Chome, reasonably well on Firefox and Opera, and is usable (if slow) on IE.

http://phantom-inker.livejournal.com/tag/procolor
http://procolor.sourceforge.net/index.php

Monday, May 11, 2009

JavaScript language advanced Tips & Tricks

These tips and tricks are not related to any browser or any Document Object Model (DOM), they are only general purpose tips and tricks for the JavaScript language.

Some of these tricks are using a latest version of JavaScript language (v1.8) and cannot run with the Microsoft Implementation of JavaScript (v1.5).

All these tricks has been tested with the Mozilla SpiderMonkey/TraceMonkey JavaScript engine (v1.8).

http://code.google.com/p/jslibs/wiki/JavascriptTips

Using Sizzle with Prototype

Recently, John Resig of jQuery fame released the selector engine used in the new version of jQuery called Sizzle.
Sizzle is a new take on using CSS selectors within Javascript and aims to be far more efficient than the methods commonly used by most current Javascript libraries.
//Overwrite findChildElements to use Sizzle http://sizzlejs.com
Selector.findChildElements = function(element, expression){
expression = expression.join(", ");
var results = Sizzle(expression, element);
if(results.length > 0){
for(var i=0; i < results.length; i++){
results[i] = Element.extend(results[i]);
}
}
return results;
};
http://briancrescimanno.com/2009/03/24/using-sizzle-with-prototype

Thursday, May 7, 2009

Ruby Toolbox

Toolbox_red-256x256

Know your options!

Ruby developers can choose from a variety of tools to get their job done.

The Ruby Toolbox gives you an overview of these tools, sorted in categories and rated by the amount of watchers and forks in the corresponding source code repository on GitHub so you can find out easily what options you have and which are the most common ones in the Ruby community.


http://ruby-toolbox.com

Tuesday, May 5, 2009

Compass

Compass is a real stylesheet framework, not a collection of classes. With Compass, you still use the best of breed css frameworks (blueprint, yui, 960); ported to Sass to make them easier

Compass is using some very new features of Sass. You must install the lastest haml code to run Compass.

http://compass-style.org
http://wiki.github.com/chriseppstein/compass/getting-started
http://acts-as-architect.blogspot.com/2008/11/compass-primer.html

Sunday, May 3, 2009

960 Gridder

960 Gridder is an excellent tool for any web developer/ designer that wants to easily align, match and/or lay out websites.

The idea came when designing a website for a student organization where I worked with several designers that handed their lay outs and designs in Photoshop format with a similar grid built-in to me. After a while I noticed how hard it became to make sure everything looked exactly how they intended it, especially in the different browsers.

960 Gridder is cross-browser compliant and works well in Internet Explorer 6/7/8, Firefox 2/3 and Chrome. Safari 4 Beta and Opera 9 is also working as expected and it should work in Safari 2.x-3.x also.

http://gridder.andreehansson.se

RestfulX

RestfulX is a framework that brings the design principles and productivity of Rails to Adobe Flex and AIR development and makes integration with RESTful Web Services as simple as possible. If you want to use Ruby on Rails, Merb, Sinatra, CouchDB or Google App Engine and you want a UI that puts the word Rich into Rich Internet Applications give RestfulX a spin. It only takes 5 minutes to get started. Instead of WSDL, SOAP or other complex specifications you'll find a few common conventions that help you to abstract your application from repetitive CRUD code and switch/synchronize between various data providers with minimal effort.
  • Adobe Flex/AIR Developers. If you know your data-binding inside out and you can run circles around component life-cycle RestfulX can help you focus on making your application stand out instead of figuring out what to do with the data that comes in JSON and XML or how to use SQLite.
  • Ruby and Python Developers looking to use Adobe Flex or AIR technologies to create rich internet experiences. Even if you have little or no knowledge of ActionScript 3.0 you should be able to start creating functional Flex and AIR applications in no time.
http://restfulx.github.com