Articles

Learning Haskell

To get my mind off Ruby I recently started dabbling in Haskell. I really like what I’ve seen so far and it seems I’m finally starting to understand functional programming (my two attempts with Practical Common Lisp never got past the first few chapters).

Prototype, emptyFunction and callbacks

Let’s say we have a JavaScript function that looks like this:

function plot(options) {
  options = options || {};
  this.onUpdate = options.onUpdate;

  //
  // more code to do something interesting
  //
}

Here the plot method allows an optional onUpdate callback to be specified. The problem is that every time we should use the callback, we have to check that it was actually provided, like this:

Present.ly Adds LDAP Authentication

We want to make Present.ly a seamless part of your organization’s workflow. To that end we are excited to announce a new feature that is finally ready to enter beta: LDAP Integration! With LDAP, you can allow your employees to use the same credentials to log in to Present.ly that they use to log in to your other business services, making it easier and more secure by utilizing your existing processes.

Rails template for Google app engine

I know, there is already too much buzz out there that talks about the new GAE's java support but I was sure I end up trying it.

I was following the Ola's post, it's quite simple to configure a rails project to deploy it on GAE, but I didn't want to repeat all those steps every time I'll deploy a new application, so I just wrote a rails template that adds all that stuff to my projects.

Using Blocks for Robustness

Ruby’s blocks can be used for many purposes — in fact, they might well be the most used feature of the language. Today we will start looking at a frequently-used idiom, analyze its implications for robustness and demonstrate how blocks can greatly improve it.

Boost speed and save bandwidth with Apache's mod_deflate

In web 2.0 applications, snappy response is important so that the user doesn’t get frustrated, or confused about what’s going on. Apache’s mod_deflate (previously mod_gzip) helps by reducing the amount of traffic between your server and their browser. Obviously, turning on compression on your server will add a little bit of extra load, but in most cases this is outweighed by the increase in performance due to the decreased bandwidth.

Rails gotchas: shoulda not_allow_values_for

If you're using should_not_allow_values_for and getting a failing test something in the lines of:
Failure:
test: User should not allow email to be set to "b lah". (UserTest)
[/usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/lib/shoulda/assertions.rb:56:in `assert_rejects'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/lib/shoulda/active_record/macros.rb:174:in `__bind_

BucketWise: Preview #2

“Buckets” is now “BucketWise”. The name was more unique, easier to identify as an application, and just felt better than “Buckets”.

To celebrate the new name, I’ve also made another screencast, this one demonstrating BucketWise’s anti-debt features. It’s a bit more long-winded than the first one: five and a half minutes of me talk-talk-talking:

BucketWise Preview #2 (QuickTime, 5:30, 10MB)

A brand-new look Linux for Rails

After just over a month since its first release linux for rails changes look.

The new look comes from the generous donation of Luca Pette (one of the authors of Linux for rails), this layout is a custom implementation of Acts as my self (lucapette’s blog).

Thank you very much Luca

Dwemthy's Array Study Note

Do you know Dwemthy's Array?YES... it's a Ruby mini adventure game written by _why to teach us about Ruby Metaprogramming. It's also included in his famous poignant guide to Ruby, Chapter 6.I read his guide and learned my first Ruby Metaprobramming. This is my tiny study note. ;-)# dwemthys_array_opening.pngHope it helps,ashbb

Chargify: Rails Powered Recurring Billing Service With An ActiveResource API | Rails Fire

Chargify: Rails Powered Recurring Billing Service With An ActiveResource API

Send to friend

Over the last couple of months, a new billing and subscription company - Chargify - have been popping up around the Web 2.0, SaaS, and Rails scenes. Notably, Chargify's CEO is Lance Walley, co-founder of Rails hosting company Engine Yard. Rails developers are a pretty entrepreneurial lot and Chargify have a lot to offer Rails developers who need to set up billing systems.
Upside? Dead Simple Billing
In short, Chargify offers "recurring billing for Web 2.0 & SaaS companies." Once you've started an account (which is free, until you top 50 customers) you can add information about your merchant account, products, subscription plans and pricing models. Then you either direct your customers to a Chargify hosted payment page or supply payment details through an ActiveResource-powered API, and billing is done.
Downside? Merchant Account Needed
Sadly, it seems that Chargify is authorize.net only right now. I asked them whether they were considering adding other systems such as PayPal, but that's not currently a priority. You currently need a merchant account (or be ready to apply for one through them). For other systems, however, there are other services such as Spreedly (which supports 10 different systems and has a gem built by a third party - Richard Livsey).
All Rails: Backend and API
I spoke with Jonathan Kay and Michael Klett of Grasshopper (the company behind Chargify) and it turns out they're Rails powered back and front. Not only that, but their API (chargify_api_ares) is too. Here's some example code for creating a recurring billing record in their system (assuming you've already added the customer to the system - just one other API call):
# Create a subscription from a customer reference
subscription = Chargify::Subscription.create(
:customer_reference => 'moklett',
:product_handle => 'chargify-api-ares-test',
:credit_card_attributes => {
:first_name => "Michael",
:last_name => "Klett",
:expiration_month => 1,
:expiration_year => 2020,
:full_number => "1"
}
)

# Update credit card information
subscription.credit_card_attributes = {:full_number => "2", :expiration_year => "2015"}
subscription.save
Nice, right? It's ActiveResource powered but doesn't necessarily require Rails.
Demo App
Nathan Verni has put together an entire Rails demo app for showing off how Chargify works from a Rails POV. Compared to the old school wrestling with payment systems directly, it's ridiculously easy.
Disclaimer: Chargify is a Ruby Inside advertiser but this is not a paid post or similar. It merely comes from editorial interest caused by talking with them a lot!
Tweet This Post