Articles

Ruby – Variables

Scenario 1: Local variable

class Ordin
def first
a=10
puts a
end
def second
puts a
end
end

obj=Ordin.new
obj.first
obj.second

output:

variable_explanation.rb:11:in `second’: undefined local variable or method `a’ for # (NameError)
from variable_explanation.rb:17

10

Description:
a –> works only inside of first method

———————————————-

Better Ruby Idioms

Carl and I have been working on the plugins system over the past few days. As part of that process, we read through the Rails Plugin Guide. While reading through the guide, we noticed a number of idioms presented in the guide that are serious overkill for the task at hand.

Car Finder Becomes a Hit Application for iPhone

We released Car Finder just over a week ago and the amount of attention we’ve received is much more than we could have ever anticipated. For those of you who don’t know, Car Finder is an iPhone application that utilizes augmented reality to help you find where you parked your car.

show_response to help debugging functional tests

While writing functional tests, I use assert_tag a lot. Many times the assertion fails and debugging with ‘response text’ dump on terminal is not easy. It would be much easier to debug if the response text is opened in a browser. This is how that can be done.

In your test/test_helper.rb add a new method called show_response.

Consuming XMPP PubSub in Ruby

XMPP is a very versatile protocol with well over several hundred proposed and working extensions, which has also proven itself in production (ex: Google Talk). Presence, roster management, federated and server to server (S2S) messaging are all examples of features that you get for free, which make it a very appealing platform for messaging applications.

#347 | “Rails Rake Tasks Reference” in Category: Cheat Sheets

»Synchronizing Core Data With Rails 3.0.0.pre«

Config So Simple Your Mama Could Use It

In which I clog a bit of code for simple application configuration.

Tonight, Kastner asked me if I had anything to do some simple configuration for something he was working on. I’ve got a simple module and yaml file that I’ve been using so I gist’d it. It then occurred to me that I might as well share it here too.

The Yaml

Below is an example of the yaml file. Basically, I setup some defaults and then customize each environment as needed.

The Ruby Show 99: Here's a YouTube link (NSFW) for those that haven't heard it and don't get the joke.

Episode #99 Like a Boss edition. Here's a YouTube link (NSFW) for those that haven't heard it and don't get the joke.

Rails Envy Podcast – Episode #099

Episode #99 Like a Boss edition. Here’s a YouTube link (NSFW) for those that haven’t heard it and don’t get the joke.

#346 | “Teach Me To Code” in Category: Blogs/Podcasts

»Synchronizing Core Data With Rails 3.0.0.pre«

Articles | Rails Fire

Articles

Rails and Merb Merge: The Anniversary (Part 1 of 6)

A year ago today, we announced that Rails and Merb would merge. At the time, there was much skepticism about the likelihood of the success of this endeavor. Indeed, The most common imagery invoked by those who learned about our plans was a unicorn.

Shoes Japanese Manual

CouchDB

CouchDB d'Apache est une base de données distribuée, sans schéma et orientée document accessible via une API REST HTTP/JSON.

Les bases

CouchDB est un serveur de base de données orienté document, accessible via une API JSON REST utilisant le langage Javascript comme interface. CouchDB est une base de données non relationnelle, non orientée objet qui va dans le sens contraire de celui des conventions Rails: la structure de données ORM. CouchDB n'a pas pour but de remplacer ActiveRecord ou n'imp…

Shared MySQL improvements

Over the last few weeks we’ve been working on scaling our shared MySQL facilities. Until recently, we’ve been able to run a single (albeit hefty) shared MySQL cluster but due to growing demand we’ve needed to scale this up considerably. The main cluster has had some performance problems recently and, while some tuning and vertical scaling bought us some time (we more than doubled the resources of the main cluster), the real focus has been on horizontal scaling.

GMail on Engine Yard

Jump to the end of this if you just want the solution I found, the rest of this includes the trials and errors that didn't work, but may help someone find this page.We have an application on Engine Yard that is configured to use GMail to send email. Everything works fine in development, but in production, we get the following error:Net::SMTPUnknownError (530 5.7.0 Must issue a STARTTLS command

iPhone Views I

Co-authored by Alex Vollmer, author of the Evri iPhone app and the PeepCode Screencast on MacRuby.

Whether or not you watched our first iPhone Screencasts, you’ll be able to jump straight into iPhone views in this screencast.

Rails single-sign-on with rubyCAS

As our rails apps multiply, we began looking for a single-sign-on solution - to give some sense of a seamless 'application' to our users.

Apache x-sendfile module for Ubuntu Hardy

We’ve just added Caspar Clemens Mierau’s package for the Apache x-sendfile module to our Ubuntu Hardy package repositories, so now it’s trivially easy for Brightbox customers to start using it. We’ve also built an AMD64 version too.  Just install the package, enable it and reload Apache:

Ruby & WebSockets: TCP for the Browser

WebSockets are one of the most underappreciated innovations in HTML5. Unlike local storage, canvas, web workers, or even video playback, the benefits of the WebSocket API are not immediately apparent to the end user.

Aleksey Gureiev Winner RPCFN #4

In this brief interview, Satish Talim of RubyLearning talks to Aleksey Gureiev of Ukraine, winner of the fourth Ruby Programming Challenge For Newbies.

Aleksey Gureiev

USA | Rails Fire

USA

Paul Barry Winner RPCFN #8

In this brief interview, Satish Talim of RubyLearning talks to Paul Barry of USA, winner of the eighth Ruby Programming Challenge For Newbies.

Charles Feduke Winner RPCFN #2

In this brief interview, Satish Talim of RubyLearning talks to Charles Feduke of USA, winner of the second Ruby Programming Challenge For Newbies.

Charles Feduke

Syndicate content