Friday, June 17, 2011

Solution: Error while pushing updated Gemfile into heroku

Error:

FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler


your should commit the modified files first, then use the below line to refresh your Gemfile.lock and then add & commit with git.

rm -rf .bundle && bundle install && git add Gemfile.lock && git commit -m "Added Gemfile.lock"

make use of heroku hosting!!! Its really awesome!

Monday, November 1, 2010

Browser Back / Forward button issues can fix by client side itself

Usually as a server side developer, we will solve this browser back / forward issue by writing server side script conditions. But we can fix it by client side itself.



There are a couple of things to keep in mind when using the above method to force a browser to not cache a Web page:

* Pragma: no-cache prevents caching only when used over a secure connection. A Pragma: no-cache META tag is treated identically to Expires: -1 if used in a non-secure page. The page will be cached but marked as immediately expired.
* Cache-Control META HTTP-EQUIV tags are ignored and have no effect in Internet Explorer versions 4 or 5. ( No worries, hope all you know even IE6 itself dead i.e officially announced by MicroSoft )

Its pretty cool right!

Monday, June 28, 2010

Change your existing/saved SVN user to other user on your UNIX machine or MAC OSx

Locate and find your .subversion directory, mostly it will under your home directory.

.subversion/auth/svn.simple/random-numbered-file ( without extension )

for eg ( in my machine ) :

Jackys-MacBook:svn.simple gokulamurthy$ ls
772c71669d28a02d42addb1d967d1862
Jackys-MacBook:svn.simple gokulamurthy$ vi 772c71669d28a02d42addb1d967d1862

K 8
passtype
V 8
keychain
K 15
svn:realmstring
V 42
SVN Access
K 8
username
V 14
your-existing-svn-username
END

change your existing svn username to current username then save and close the file.

when you do any operation under your subversioned directory like svn ls , svn log, svn up, svn switch, etc., for any operations it will ask you enter the svn new username and password.

Thats all. Have Fun with SVN.

Saturday, June 26, 2010

SVN log commands must be useful

SVN List of all files modified/added/deleted by a particular user:

svn log | sed -n '/username/ p'

For multiple users:
svn log | sed -n '/username/,/-----$/ p'

SVN List Comment and Files Changed for a Certain Revision:

svn log -v -r RevisionNo https://yoursvnurl.com

Hope this will help.

Tuesday, November 17, 2009

extended array or specifically enum methods in ruby

The methods available for enum is pretty much useful when we need to make block with the condition. Below are the few example methods:

%w{ ant bear cat}.all? {|word| word.length >= 3} #=> true
%w{ ant bear cat}.all? {|word| word.length >= 4} #=> false
[ nil, true, 99 ].all? #=> false


%w{ ant bear cat}.any? {|word| word.length >= 3} #=> true
%w{ ant bear cat}.any? {|word| word.length >= 4} #=> true
[ nil, true, 99 ].any? #=> true


Enjoy coding...

Wednesday, October 28, 2009

OOPS: Creating object for an Interface is Possible

    Use the below sample code to create an object for an interface. This is called as "anonymous inner class".
What's happening here is that an object gets instantiated that implements the interface.

    public interface MyInterface {
    public void myMethod() ;
    }

    ...

    MyInterface myIntfObj = new MyInterface() {
    public void myMethod() {
    ....
    }
    };

    myIntfObj.myMethod();


Thursday, October 22, 2009

install gems by .gem files

To install gems by .gem files use the below command on command prompt or terminal.

Note: To download .gem files for a specific gem, do a search in rubyforge.org

gem installinstall-dir PATH library_name

then the output will like this
Successfully installed library_name.version
1 gem installed

Hope this will help for someone or me!!! :)