• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

An Idea for Open Avatar Exchange

I am using GRAVATAR at github.com. It is very interesting service that provides globally recognized avatar image from a hash of email address. What is clever is a service using GRAVATAR can present its user's avatar without not exposing his/her email address.

But the GRAVATAR is not the only provider of such avatars. For example, twitter.com has huge database of mapping from email address to avatar image. There are a lot of services which have such the database.

Imagine twitter.com, facebook, linkedin and so on provide their avatar images by the same manner. We can provide avatar image for every user of which we know his/her email address everywhere and quite easily. This is the principal advantage of this idea.

But what is advantage for provider? That's the obvious question. Answer is inter-service completion of avatar images. In each service, not all users have his/her avatar image. For such users, the service provides disappointing default avatar image. But if there is the open avatar exchange, the service can try to find it in other services instead.

The way to make the exchange is really simple. Provide REST API to map MD5 hash of email address to avatar image. Block accesses from domains you don't want to exchange.

In addition, avatar providers can harvest stats of the sites that are using your avatar image.

posted by Png takiuchi on Mon 23 Feb 2009 at 08:21

The ruby-1.9.1 had come to the world, and several days went by...

@maiha and I have worked for making the merb to be correspond to the ruby-1.9.1. And now we are very happy, because we can announce there is the first child of Merb and ruby-1.9.1.

http://merbi.st is the site which is running on merb with ruby-1.9.1.

ss

Our efforts are remaining at several places. Most of them are in github (see http://github.com/maiha, http://github.com/genki). Others are published on here http://merbi.st/plugins

Good luck!

posted by Png takiuchi on Sat 14 Feb 2009 at 14:42

methopara is a gem that enables us to use Method#parameters with Ruby-1.9.1. It was originally made by @ko1_twitter, the creater of YARV, at the previous meet-up of asakusa.rb.

And this time, I added an interface to use it for UnboundMethod. Now you can use UnboundMethod#parameters with new methopara, like this.

   1  require 'rubygems'
   2  require 'methopara'
   3  
   4  class Foo
   5    def foo(a,b) end
   6  end
   7  Foo.instance_method(:foo).parameters
   8  #=> [[:req, :a], [:req, :b]]

Enjoy!

posted by Png takiuchi on Wed 11 Feb 2009 at 16:26

Needless to say, we can't live without irb. Although it is already incredibly useful, I had a desire to improve it...

like this:

ss

This is the irb_rocket that I've made. It makes irb into being as follows

  • Result follows blue #=> after your input.
  • It also be colored by Wirble.
  • Output of stderr is colored to red.

INSTALL

You must install Wirble and ruby-terminfo in advance. And then, you can install the plugin like this:

   1  % sudo gem install irb_rocket --source http://merbi.st

After that, the last task is append 2 lines below to your ~/.irbrc

   1  require 'rubygems'
   2  require 'irb_rocket'

Completed! Now you can use new irb as always.

posted by Png takiuchi on Sun 8 Feb 2009 at 17:37 with 4 comments

I made a simple plugin to explain a concept of render-filters.

merb_render_filter

In your controller,

   1  class Posts < Application
   2    before_render :set_title1, :only => :show
   3    before :set_title2, :only => :show
   4  
   5    def show(id)
   6      @post = Post.get(id)
   7      display @post
   8    end
   9  
  10  private
  11    def set_title1
  12      @title = @post.title # <= you can access to @post here
  13    end
  14  
  15    def set_title2
  16      @title = @post.title #=> @post is nil!
  17    end
  18  end

Without this plugin, you couldn't access to instance variables from before-filters. Of course you can prepare @post in the first before-filter so that you can access from other before-filters. But why Merb has the action-args? They are ignored in such case. This was the problem I wanted to solve by the plugin.

posted by Png takiuchi on Sun 1 Feb 2009 at 10:19
Contents
An Idea for Open Avatar Exchange
merbi.st is now powered by Ruby-1.9.1!
methopara-0.3.0 Released
irb_rocket: An irb plugin that makes irb #=> result style
merb_render_filter for ease of accessing to ivs
Comments
Spencer: You don't have to re-compile it, this version w... '14-4
staiano: Any chance we can get a recompile for 10.9? '14-1
falsefalse: @tiancongxin try using this one https://github.... '12-2
tiancongxin: TerminalCopyOnSelect not work on OS X 'Lion' , ... '11-7
staiano: Roderick you rock for recompiling it. Thanks. '11-3
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ