branch4 Blog

Internet development with every single possibility.

[Rails] Couldn’t Find User With Id=sign_in

| Comments

Background

While using devise on rails3, I got the following error message.

    
      Couldn't Find User With Id=sign_in Devise on Rails 3
     
It was working yesterday, but not today.

Solution

I checked config/routes.rb, and had

    
      resources :users
      devise_for :users
     
which seemed to be interupting each other.
So I commented out resources :users, and it started to work fine.
I don’t know why it kept working till yesterday…

[1 Liner] Easily Replacing a Domain in Multiple Files

| Comments

Just 1 liner I sometimes use.

    for i in `find -type f`;
    do
    grep "xxxxx.yyyyy.jp:1080" >& /dev/null $i;
    if [ $? -eq 0 ]; then
      sed -i.bak -e s,http://xxxxx.yyyyy.jp:1080,https://aaa.bbb.com, $i;
    fi
    done 
This will…

  1. find files that contains “xxxxx.yyyyy.jp:1080”
  2. replace http://xxxxx.yyyyy.jp:1080 => https://aaa.bbb.com

[Android] onClick Event With ImageView

| Comments

Purpose

As said in the title.
It was my first shot using onClick event with ImageView, so just for memo.
(in fact it’s my first Android development)
Keep in mind that this seem just to be one way of implementing onClick event with a view.

[KVS] Redis入門

| Comments

業務で少しRedisの勉強をしたので、そのメモ。


Redisとは

Redisは、KVS(Key-Value Store)の一種。
Web-site : http://redis.io/
Current stable : 2.8.8
License : BSD

[Git] Tagging in Git

| Comments

These are some commands I use when taggin in git.

Or say…some commands I will be using, since I haven’t really started using them.

Work flow of git in my environment.

  • debugging in master branch
  • little bug fix in master branch
  • new branches for major fix/new features
(beware that I’m developing alone)

What I want to accomplish

  • I want to tag the source before releasing
  • I want to maintain files(add/delete/change revision) in exisisting tags
  • I want to accomplish this easily
  • I want to learn git