Target IE6 and IE7 Browsers without Conditional Comments

Need to target IE browsers? Here is a quick hack that doesn’t require conditional comments (note that your CSS will therefore not pass auto-validation, which is fine if you are aware of why it doesn’t). The code below will change the background-color of divs depending on what browser the user is viewing the web page […]

Recover MySQL root Password

You can recover MySQL database server password with following five easy steps. Step # 1: Stop the MySQL server process. # sudo /etc/init.d/mysql stop Step # 2: Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password. # sudo mysqld_safe –skip-grant-tables & Step # 3: Connect to […]

Easy Web Fonts with Google Font API

Web fonts allow you to step outside of the normal web-safe fonts by taking advantage of CSS’s @font-face rule. However, right now, browsers aren’t uniform in its implementation of @font-face. More specifically, web browsers differ in the types of font files they support (hopefully this will change with the WOFF standards). Additionally, you must be […]

Loading data from multiple files in Ruby using Hash

Loading data into Database reading from multiple files was never easy. I have been working on different projects lately, which required such exercise often. A general technique I followed to do that is explained here. In a gist, this is what it looks like: require ‘rubygems’ require ‘fastercsv’ files.each do |key, value| file = “#{RAILS_ROOT}/db/drugsatfda/” […]

Adding close link to flash messages

The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action that sets flash[:notice] = “Successfully created” before redirecting to a display […]

Top 10 Tips For Database Design

Sometime back I found a document which provides top 10 tips which can help to ensure that databases are created that can be easily exported and manipulated with the minimum of difficulties. Thought I should be sharing this with all of you. The 10 Tips: 1. 1. Develop A Prototype Significant time can be saved […]