13-Jun

2011

Comments

Introducing Cool Tabs, the best way of managing your Facebook fanpages

Last March 11th, Facebook removed the ability to install the “Static FBML” application. That left lots of people without the ability to display in their Fanpages custom HTML easily.

Now people would have to build a Facebook application, contract a web server, install their Facebook application there, and worry about the hosting, images, everything.

That’s why we released http://cool-tabs.com to help you build a tab for your fanpage. In a couple of minutes you can build a tab for your fanpage. We’ll host it, configure it, take care of your images and assets, etc, etc.

You can choose between lots of Facebook application to install in your fanpage. You are not limited to displaying some custom HTML. We can render your tweets, your flickr’s account photos, your blog, a youtube’s channel,…

That for rendering content. Do you want a way of engaging your customers? Getting more fans? We also provide applications for that. You can check our application to build contests for your fans and our application to invite friends to your Facebook page.

You’ll be able to display Facebook comments and share buttons in every tab, so you can have every user participating in your Facebook page.

Here’s our tutorial and some samples, so you can get the idea of how it works, and what you’ll be capable of doing.

If you need any more information, you can reach us at our contact page. Don’t hesitate in asking, if you’ve any doubt about the service!

29-Jan

2011

Comments

Exporting databases to yml with yaml_db

We’ve been using yaml_db successfully to dump records from our production database, and use them as fixtures to bootstrap a new project.

The only problem is, some of our tables are huge, and we don’t want to import them.

So, we’ve added support to dump only selected tables to yaml_db.

You can use this as:

    rake db:data:dump_dir filter_tables=^table[0-5]$|other_table
    rake db:data:dump filter_tables=^table[0-5]$|other_table

(Beware that the filter_tables paramater is evaluated as a regular expression (with Regexp.new(filter_tables)), so:

    rake db:data:dump_dir filter_tables=mytable

will dump mytable, but also mytable_join_other_table.

We hope this will be merged into upstream. Up to then, you can get it in https://github.com/gaizka/yaml_db/ (for rails3), and https://github.com/gaizka/yaml_db/tree/Rails2 (for rails 2 support).

Enjoy!!

10-Jan

2011

Comments

Build your own mini Rspec clone in Ruby (Part 1 of N)

Are you crazy? Rspec is pretty complex and works like a charm. Why would you want to do that?

Because it’s a good learning exercise

This is not in my New Year’s resolutions list, but I think learning a little more of Ruby won’t harm me.

So I’ve decided to try to implement the simplest, dumbest clone of rspec, just to see if I am capable of doing so.

Also, I won’t ever try to emulate every rspec feature, so I’ll try to make the “Simplest thing that will possibly work (©)”, forgetting about extensibility of code, etc, etc.

Fortunately, I haven’t read any of Rspec source code (I do have checked plenty of times the Rdoc API doc, so I guess I maybe am cheating), so it’ll be a good exercise.

After that, I’ll read the real source code, to see how real professionals manage to write wonderful Ruby.

What features will it support?

Just a small subset of Rspec:

  • Simple describe blocks (Not nested, at least in first version)
  • before, after blocks
  • Tests defined with it blocks and a name
  • should, should_not, with just eql matcher (Ej: “wadus.should == 10”, “wadus.should_not == 20”)

Spec example we want to be able to run:

Our first target is to able (at first) to execute the simplest spec file:

describe "Cuakspec suite 1. Testing:" do
  it " a simple assertion with eql" do
    true.should == true
  end

  it " a test failure" do
    false.should == true
  end
end

First, let’s run it with real rspec:

$ rspec -f d spec/target_spec1.rb 

Cuakspec suite 1. Testing:
   a simple assertion with eql
   a test failure (FAILED - 1)

Failures:

  1) Cuakspec suite 1. Testing:  a test failure
     Failure/Error: false.should(eql(true))
       
       expected true
            got false
       
       (compared using eql?)
     # ./spec/target_spec1.rb:8:in `block (2 levels) in <top (required)>'

Finished in 0.00205 seconds
2 examples, 1 failure

Our target will be to be able to execute it with our dumb rspec-clone, and get something like:

$ ./dumbspec spec/target_spec1.rb 

  Cuakspec suite 1. Testing: a simple assertion with eql OK
  Cuakspec suite 1. Testing: a test failure ERROR
  expected true, got false, ./spec/target_spec1.rb:8

Stay tunned for more posts about this…

25-Sep

2010

Comments

Examples of rspec custom matchers

This is an example of what you can do with rspec custom matchers.

If you have to test lots of atributes of an object, your spec can get sort of ugly:

    user.login.should == "pepe"
    user.age.should == 30
    user.password.should == "waduswadus"
    user.whatever.should == "something"
    user.i_am_getting_tired.should == "me_too"

Do you prefer this?

    user.should have_these_attributes({
      :login => "pepe",
      :age   => 30,
      :password => "waduswadus",
      :whatever => "something",
      :i_am_getting_tired => "me_too" })

This is easily done with rspec custom matchers.

Keep reading...

24-Sep

2010

Comments

Bundler, Rails 3 and irbrc problems

It’s about time I start playing with Bundler. Up to know, it looks terrific (just need to get used to the commands and see where my gems get located).

I’ve just found something I don’t like that much.

In my $HOME/.irbrc, to make my life happier by having fancy colors in the development console, I have:

  require 'bond'
  require 'ap'
  require 'wirble'
  Wirble.init
  Wirble.colorize 
  require 'map_by_method'

Up to now, I just needed to gem install bond awesome_print map_by_method before I started coding.

Now, i need to add this to every project I develop, in the Gemfile:

  group :development do
    gem 'bond'
    gem 'wirble'
    gem "awesome_print"
    gem "map_by_method"
  end

So, I force every developer in my team to install those gems (OK, maybe that’s not a bad thing :).

Maybe there is an option to have an extra, optional Gemfile.local, that bundle can use it so I can load my .irbrc without disturbing my team?

Do you know about it?

20-Sep

2010

Comments

Troubleshooting compiling ruby 1.9.x with RVM in Ubuntu Karmic

If you try installing ruby 1.9.x with RVM in Ubuntu Karmic, maybe you have found this error:

    ossl_x509name.c: In function ‘ossl_x509name_to_der’:
    ossl_x509name.c:328: error: ‘struct RString’ has no member named ‘ptr’
    ossl_x509name.c:328: error: ‘struct RString’ has no member named ‘len’
    make[1]: *** [ossl_x509name.o] Error 1
    make: *** [mkmain.sh] Error 1

Keep reading to get to know how to fix it:

Keep reading...

09-Jun

2010

Comments

Remote Linux desktop login with remote GDM

The other day I needed to log into a graphical session in a remote server, and the information I found in the Internet was not really up to date.

Anyway, that’s what I did, and it worked flawlessly.

I did not care too much about security, this remote desktop is actually in the next room, but i don’t have a monitor to plug it into anymore :)

Don’t try this at home if you don’t trust your network.

Keep reading...

09-Jun

2010

Comments

Lanzando Metroroto, un sistema colaborativo para traquear incidencias en el metro de madrid

Hoy hemos lanzado metroroto.com, es un sistema colaborativo para intentar traquear las incidencias y averías del metro de madrid al instante.

Más información en el blog de cantorrodista

20-Feb

2009

Comments

APIdock + emacs integration

Inspired by the post APIdock + vim integration, and feeling jealous for a second, i’ve thought: “Hey, this can be easily done with emacs!!”

So, here you have APIdoc + emacs integration.

Just copy it to somewhere in your emacs path (i.e., ~/.emacs.d), and add this line to your ~/.emacs:

(eval-after-load 'ruby-mode '(require 'rails-apidock))

Keep reading...

05-Feb

2009

Comments

Interceptando y examinando excepciones en una sesión de IRB

Cuando estás desarrollando con Ruby, generalmente (yo al menos), pasas bastante tiempo dentro de una sesión de IRB. Vas probando pequeñas funciones que has escrito, exploras una API de otro, etc, etc.

A veces, quieres probar una función que se supone que debería funcionad, pero está lanzando una excepción. Y el backtrace te muestra que el error está demasiado metido dentro del código como para hacer debug paso a paso.

Keep reading...

05-Feb

2009

Comments

Catching and examining exceptions in a IRB session

When developing with Ruby, I usually spend a lot of time inside a IRB session. You can test little helper functions you are using, etc, etc.

Sometimes, you want to test one function that is not supposed to throw an exception, but is doing so. And the backtrace shows you that the error is buried very deeply in your code.

Keep reading...

27-Oct

2008

Comments

Using msmtp with gnome keyring

If you use mutt to manage your mail, you are probably using msmtp to manage your mail delivery.

Probably you don’t like the fact that you have you store your SMTP password unencrypted in your $HOME/.msmtprc file.

Fear no more! Satoru Satoh has added support for the GNOME keyring, and, thanks to Martin Lambers, that’s already in the CVS tree.

Keep reading...

14-Oct

2008

Comments

Using rtags ang gtags for coding Ruby

Boring intro

When I was a C and Java developer (not that long ago), I always used the GNU GLOBAL source code tag system gtags.

Despite it’s awful, impossible-to-find-in-google name, it’s a wonderful system to navigate around your code: find function definitions, where they are used, fast “grepping” of code, you name it.

And, most important, it’s emacs support is wonderful!!

You can check their tutorial. It’s a little bit scary at the beginning, but, really, you should try it.

I want to show you how i use gtags when coding Ruby. Hopefully it will be useful to somebody else.

Keep reading...

14-Oct

2008

Comments

Listing keys used in a memcached server

Maybe this is of no use to anybody, but it was useful to me while developing some caching code, so I hope it can be useful to someone else.

This is a script will list every key that’s being used in a memcached server.

I haven’t tried it in a production server, and you sholud be careful doing it. It looks that some of the commands are blocking and can affect the performance for the rest of the clients.

Keep reading...

Cosas interesantes

  • eClimbs
  • Cool Tabs, crea pestañas para Facebook
  • Puntos Geodésicos
  • Metroroto

Tags