Archive for May, 2010


>Firebug is without doubt one of the greatest assets to web development available; I certainly use it on a daily basis when developing for the web, and I know it’s the plugin of choice for many others too. An unfortunate side-effect of Firebug’s excellence is that other similar tools for other browsers pale in comparison and appear inferior. Trouble-shooting layout issues and CSS bugs in IE for example can be a lesson in futility.

This is where Firebug Lite steps in; this is a simple JavaScript library that recreates most of the key features of the Firebug interface, bringing our debugger of choice to all other platforms. Fixing layouts and troubleshooting cross-browser issues becomes easy once more.

One of the greatest things about Firebug Lite is that you don’t need to download it or install anything in order to start using it; when you want to debug a page you’re working on in browsers that aren’t Firefox you can just include a script file whose SRC points to the online version:

< script src=”http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js&#8221; type=”text/javascript” >
< /script >

That’s it, when you run the page in any other browser, Firebug Lite will be present on the page. For off line use, the script file, as well as a CSS file, can be downloaded and should just be used like any other JS or CSS file. The following screenshot shows Firebug Lite in Safari:

Advertisements

Use Firebug in any Browser

Posted: May 27, 2010 in Uncategorized

Firebug is without doubt one of the greatest assets to web development available; I certainly use it on a daily basis when developing for the web, and I know it’s the plugin of choice for many others too. An unfortunate side-effect of Firebug’s excellence is that other similar tools for other browsers pale in comparison and appear inferior. Trouble-shooting layout issues and CSS bugs in IE for example can be a lesson in futility.

This is where Firebug Lite steps in; this is a simple JavaScript library that recreates most of the key features of the Firebug interface, bringing our debugger of choice to all other platforms. Fixing layouts and troubleshooting cross-browser issues becomes easy once more.

One of the greatest things about Firebug Lite is that you don’t need to download it or install anything in order to start using it; when you want to debug a page you’re working on in browsers that aren’t Firefox you can just include a script file whose SRC points to the online version:

< script src=”http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js&#8221; type=”text/javascript” >
< /script >

That’s it, when you run the page in any other browser, Firebug Lite will be present on the page. For off line use, the script file, as well as a CSS file, can be downloaded and should just be used like any other JS or CSS file. The following screenshot shows Firebug Lite in Safari:


>

The Google Font API provides a simple, cross-browser method for using any font in the Google Font Directory on your web page. The fonts have all the advantages of normal text: in addition to being richer visually, text styled in web fonts is still searchable, scales crisply when zoomed, and is accessible to users using screen readers.

Getting started using the Google Font API is easy. Just add a couple lines of HTML:

<link href='http://fonts.googleapis.com/css?family=Tangerine' rel='stylesheet' type='text/css'>

body { font-family: 'Tangerine', serif; }


>A lot of people are wondering why date/time functions are working differently in PostgreSQL 7.2 and up. For example queries like the following no longer work:

CODE:1
SELECT id FROM orders
WHERE interval(current_timestamp – order_date) < interval(‘1 month’);

INTERVAL is really not a function. It is a datatype and an operator. In earlier version of PostgreSQL, you were allowed to ‘sort of’ use it as a function, but that no longer exists. Instead, try to either:

CODE:2 cast your value to an interval datatype:

SELECT id FROM orders
WHERE (current_timestamp – order_date) < (‘1 month’)::interval;

CODE :3 you can use the “interval” keyword as an operator to a timestamp representation:

SELECT id FROM orders
WHERE (current_timestamp – order_date) < (interval ‘1 month 3 days’);

CODE :4 it works with parentheses if you remove any ambiguity about the parentheses. (Meaning: if you need parentheses for your expression, then put “interval” in quotes:

SELECT id FROM orders
WHERE (current_timestamp – order_date) < (“interval” (current_timestamp –
      (SELECT order_date FROM orders WHERE id = 2)));

>Cakephp Cheet Sheet

Posted: May 21, 2010 in Cakephp

>Here you can find the Cakephp cheetsheet.

http://cakephp.org/files/Resources/CakePHP-1.2-Cheatsheet.pdf


>Now you can check your web design in different browsers on Browsershots.It is a free open-source online service.And you can send those screenshots to your mail also.

URL:http://browsershots.org/


>Integrating search on a website can be an incredibly complex subject far beyond my web development skills. Fortunately, Google offers a service called “Custom Search Engine” which you can integrate right into your own site. This leverages Googles awesome search power, and it can all happen directly on your own website!

URL: http://www.google.com/cse/

>Check/Uncheck Checkbox Jquery

Posted: May 18, 2010 in Jquery

><script type=”text/javascript” language=”javascript”>

    $j(document).ready(function () {

        $j(‘#checkboxToggle’).click(function () {

            $j(“input[type=checkbox]”).each(function () {

                if (this.checked == true) {

                    $j(“input[type=checkbox]”).attr(‘checked’, false);

                }

                else {

                    $j(“input[type=checkbox]”).attr(‘checked’, true);

                }

            });

        });

    });

</script>
—————————————————————————————————
IN JS
———

<html>
  <head>
    <script language='JavaScript'>
      checked = false;
      function checkedAll () {
        if (checked == false){checked = true}else{checked = false}
    for (var i = 0; i < document.getElementById('myform').elements.length; i++) {
      document.getElementById('myform').elements[i].checked = checked;
    }
      }
    </script>
  <
/head>
  <body>
    <form id="myform">
      <input type="checkbox" name="foo"/>
      <input type="checkbox" name="bar"/>
      <BR>Check all: <input type='checkbox' name='checkall' onclick='checkedAll();'>
    </form>
  <
/body>
</html>

>SELECT your_columns FROM your_table WHERE DATE(date_posted) = CURDATE();

>Codeigniter in PHP 5.3

Posted: May 5, 2010 in CI, PHP

>First, here’s how to solve the issue regarding these errors:

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\ci\system\codeigniter\Common.php on line 130

Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\ci\system\codeigniter\Common.php on line 136

In index.php in your CI folder replace line 12 “error_reporting(E_ALL);” (without quotes) with this:
error_reporting(E_ALL & ~E_DEPRECATED);” (without quotes)

Then, you’ll probably get an error about a bad URI if you try to run any controlls. It should say something like this: “The URI you submitted has disallowed characters.”


Here’s the solution for that as well. In URI.php which is located in \system\libraries replace line 189:
if ( ! preg_match("|^[".preg_quote($this->config->item
('permitted_uri_chars'))."]+$|i", $str))
” (without quotes and without the line break (it’s all one line)

to read like this:
if ( ! preg_match("|^[".str_replace('\\-', '-', preg_quote ($this->config->item('permitted_uri_chars')))."]+$|i", $str))” again without the quotes.