Scala 2.10 + Play 2.1 + Pusher

An example of using scala, play, and pusher all at once

Patent Troll of the Week


Adventures in Play 2.0 with Scala, Salat, and Casbah


How to get play-salat and play-cashbah working in the Play 2.0 Scala web framework

Scala?
Scala has anonymous functions, type inference, list comprehensions, lazy initialization, excellent pattern matching, case classes, delimited continuations, higher-order types, and complexity that exceeds 10.

What is that stuff after the mapping binder? The apply and unapply functions of the Post model are curried with the form mapping. Check out the views.html.helper package in the Play 2.0 API.

Controller: controllers/Posts.scala
View: views/posts.scala.html

Go introspection

Hmmm

rails-debate github repo

I just made my rails debates site open-source and pushed it to a github repository.

What is rails-debate? What if I hate arguing and avoid conflict?

User-driven debate site built with Ruby on Rails and jQuery. Users can create and reply to arguments and join sides. Easily deployed on Heroku after resolving gem dependencies.

Required gems

  • 'rails', '3.0.3' 
  • 'clearance', '0.9.1' 
  • "will_paginate", "~> 3.0.pre2" 
  • 'acts-as-taggable-on' 

Programmatically setting images as thumbnails in Magento

Here's how to programmatically set uploaded images as a product's thumbnail, small image, and large image.

Importing products from Magento into Spree

Magento is evil. If you're working with its PHP codebase, I'm sorry. After looking for an easier, less dangerous solution, I found Spree. Easy to use, looks half decent out of the box, and built on Ruby on Rails, the slow but easy web framework. And there's a Heroku extension. Awesome.

One problem: The Magento installation had 9000 products, with names, descriptions, SKUs, and other fun attributes. Spree has no built-in import or export function. Do I want to enter all this information manually? No.

After some googling, yahooing, and asking jeeves, I found a Google group discussion, took some of the example code, tailored it to the CSV format of a standard Magento export, and ended up with this hack:
If you don't have the FasterCSV gem installed, install it before running this import script:
gem install fastercsv

Use the Rails runner to run this script so it has access to the database:
script/runner import.rb

and you're done.