-


By Max Murphy / 2 CommentsThere are countless times throughout the day that I need to copy things from my console for many reasons, sometimes being the need to put it into an editor for easier readability, or copying ssh keys, etc.
-


By T.J. VanSlyke / 8 CommentsIf you're like me, you start a new project every week. Often, this means surfing the web for a color palette generator and meticulously copying and pasting hex values into your text editor. As I was about to do just that yesterday, I decided it would be prudent to remove that burden entirely. Thus, Sassafras was born.
-



MigrateTestDB plugin was created to allow migrations to be used to generate the test database in rake test commands. This is helpful for consistently testing migrations, but was absolutely necessary for the following use case we encountered:
Using VIEWS or STORED PROCEDURES. We were using a legacy database (a legacy MS SQL server for production, MySQL 5 for development and tests). Neither schema format (:ruby or :sql) plays nicely when exporting the schema for the database. They do not output the VIEWS nor STORED PROCEDURES so all of our tests requiring this functionality failed.
MigrateTestDB deletes Rails' default test:db:prepare task which only supports schema_format = :sql and schema_format = :ruby. The replacement task works identically (as of Rails 1.2.3) to Rails default task; however, specifying a schema_format = :migrate will cause a new preparation task to run within the plugin. The task runs migration scripts to ready the test database. The plugin leverages the existing rake tasks for purging the test database, and loading the migration scripts--so the plugin code is mainly a reglue of exisiting Rails default functionality.
This code was originally developed as a patch for railsties/lib/rake/databases.rake. The patch was developed by Andre Price under the direction of Jonathan Siegel at ELC Technologies. It was submitted for inclusion to Rails core and received the response:
http://dev.rubyonrails.org/ticket/4814#comment:1> "This is a great idea for a plugin. If you release it and most Rails developers begin using it then it might be a good candidate for core. Until then I'm going to close this ticket."
The patch was converted to a plugin by Jonathan Siegel.
December 12, 2008 / rubyonrails, rails, ruby, plugin, testing, migrations -



Do you need to store and convert currency in your project? So did we. There were a lot of options out there but none that quite fit. The best option was a gem that hasn't been updated in a while aptly named currency. That gem can be found on rubyforge with documentation here
This gem is fantastic, though a bit cryptically written, and had only a few shortcomings. A big one for us was that we couldn't set the precision without changing the gem's code itself. We had several different apps that were running on the same servers and so needed to use the same gems. So we forked it and it is now available for download/browsing/forking from github
Install the new gem from github
sudo gem install acvwilson-currencyDecember 9, 2008 / ruby, rails, rubyonrails, rubygems, gem, gems, activerecord -



ScopeControllerModel plugin was created to DRY up controller and model logic when working a common data model pattern. Particularly, when access to model data is restricted to the current_user or their account. Supposing you have:
class Invoice < ActiveRecord::Base belongs_to :account end class Account < ActiveRecord::Base has_many :invoices end
In this circumstance, there are two models: accounts and invoices. We want invoices to be restricted to the account of the currently logged in user, but also leverage scaffold_resource to make our site building nice and snappy.
December 7, 2008 / rails, ruby, rubyonrails, plugin -



S3 flash upload is a rails plugin which allow user uploading a file to your S3 bucket directly, so you can save the cost of forwarding file to S3 in your app side.
-


By ELC / 0 Comments
Numerous windows to handle multiple terminal sessions is a pain. tabTerm allows you to work productively utilizing the organized tab design that we have all come to know and love in other applications.
At ELC we love to develop applications—and we spend a lot of our time working within Terminal. Whether it's web or another project, the one feature we've always wished Apple would add to Terminal is tabs. We looked around for a solution, or to see if anyone else had this issue and we found iTerm, Terminator, Multi Gnome Terminal, and GLTerm, but not one of them met our needs. To quote Justin French:
"So how about it? Who’s going to add tabs to Terminal.app? I’d gladly donate $50 or more to the cause, and I’m pretty sure there are hundreds of like-minded people out there. "And yes, of course I’m aware of iTerm, and I probably should probably give it more than a 5 minute trial, but for whatever reason, I’ve never felt comfortable in it. More than likely it’s the distinct lack of understanding when it comes to shells and terminal related stuff, but really, I just want Terminal.app with tabs."
-


By ELC / 0 Comments
Creating a scalable web business has now become even easier. Thanks to Amazon, "capital hardware expense" can be stricken from your web-business budget. Amazon's Simple Storage Service (S3) and Elastic Compute Cloud (EC2) together make a next-generation platform for deploying highly scalable web apps.
ELC has been an early adopter of S3 and EC2 with our own products (RightCart.com uses S3 heavily and Shoperion's Page servers scale via EC2). In December, 2006 we partnered with Thorsten von Eicken to launch RightScale.com, which has since become a successful and thriving standalone company. RightScale provides a platform and expertise that enable companies to create scalable web business solutions running on Amazon’s services that are reliable, easy to manage, and cost less. RightScale makes it really easy to get your web business launched on Amazon's services.
November 17, 2008 / cloudcomputing, aws, amazon, ec2, s3, rails, ruby, rubyonrails, cloud -


By ELC / 0 Comments
RightCart is a free embeddable shopping cart system that makes it easy for content publishers to sell products on their websites. The products are sold by other RightCart members, or by third party vendors such as Amazon and CafePress. As a publisher, you get to advertise items that you choose, and are paid a commission on each sale. As a vendor, RightCart provides a new outlet for getting your product out to consumers.
We built RightCart as more than a proof-of-concept Ruby on Rails application (although it's often used as an example of a great Rails-based app). RightCart is a full-blown business all its own. What starts as a fun idea sketched out on a napkin can quickly take on a life of its own!
November 17, 2008 / rails, ruby, rubyonrails, javascript -


By Dylan Stamat / 0 Comments## 50,000 articles, title and body indexed ## sphinx via ultrasphinx plugin >> search = Ultrasphinx::Search.new(:query => "apple") >> Benchmark.realtime { search.run } => 0.27561092376709 >> search = Ultrasphinx::Search.new(:query => "cat AND dog") >> Benchmark.realtime { search.run } => 0.225758075714111 >> search = Ultrasphinx::Search.new(:query => "apple OR pear") >> Benchmark.realtime { search.run } => 0.224870184998115 ## postgres native text search via tsearchable >> Benchmark.realtime { Article.find_by_text_search("apple") } => 0.156562089920044 >> Benchmark.realtime { Article.find_by_text_search("cat AND dog") } => 0.154358863830566 >> Benchmark.realtime { Article.find_by_text_search("apple OR pear") } => 0.164685010910034
November 11, 2008 / postgres, postgresql, search, tsearch












