All posts by Morshed Alam

Rename rails3 application

Just published new version of rename gem with following changes: Sanitize new name Search/Replace module name in all files under root and config Change session key Change directory name InstallationAdd this line to your application’s Gemfile: gem ‘rename’ Uses rails g rename:app_to NewNamerails g rename:app_to “New-Name”

Website thumbnail using API

Just recently, I have developed a page cast module for Greenarrow.com to show users profile’s thumbnail image on the fly. Before doing that I have googling and found couple of good solutions: thumboo.com webthumbnail.org and webthumb.bluga.net etc. webthumb.bluga.net is the best solution in between those though it’s depend on windows hosting. You can have a…

Read More

Drag and drop from scratch using JavaScript

An example code to implement drag-ability in to an HTML element from scratch without using JavaScript library. JavaScript functions to provide drag-ability: function DDElement(ele, event) { addEvent(ele, “mousedown”, downHandler, true); addEvent(document, “mouseup”, upHandler, true); if (event.stopPropagation) event.stopPropagation(); else event.cancelBubble = true; if (event.preventDefault) event.preventDefault(); else event.returnValue = false; function upHandler(e) { e = e ||…

Read More

How to rename Rails3 application

A Rails3 application name are using as a Ruby name space for entire application and throughout the project tree as well. So, If anyone later decide to change the project name, then have to replace the name in the following files: Rakefileconfig.ruconfig/routes.rbconfig/application.rbconfig/environment.rbconfig/environments/development.rbconfig/environments/test.rbconfig/environments/production.rbinitializers/secret_token.rbinitializers/session_store.rb You can run following command in your project root, to find out the…

Read More