Generate content with CSS before or after an element
Posted on Saturday 23 January 2010
You can easily add content before or after an element . To do so the content property is used with the :before and :after pseudo-elements, to insert generated content.It’s only supposed to work only for the :before and :after pseudo-elements, but only Opera and Konqueror appear to support this. Safari and Chrome support content without the pseudo elements for images, but not for text. And for Internet Explorer, only IE8 supports the content property. For more information on the browser support for this CSS property -> http://www.quirksmode.org/css/contents.html
For example, the following rule inserts the string “Description: ” before the content of every P element whose “class” attribute has the value “descr”:
p.descr:before {
content: "Description: "
}
The following example inserts the URL in parenthesis after each link:
a:after {
content: " (" attr(href) ")";
}
this results in a URL like this on your webpage:
test (“http://www.test.com”)
Force break instead of paragraph on new lines in Tiny_mce
Posted on Friday 22 January 2010
Normally tiny_mce inserts a new paragraph when you hit return. You can make tiny_mce force a BR element on newlines instead of inserting a new paragraph. Normally you should utilize P tags instead of BR, so only use this when you have to!
Usage:
tinyMCE.init({
force_br_newlines : true,
...
});
Resetting the auto increment number with SQL (MySQL)
Posted on Tuesday 19 January 2010
When you have a table with 10 records and an auto increment field ID and you delete the tenth record e.g.The next time you insert a record, the ID will be 11 and not 10. You can reset the auto increment number by using this SQL:
ALTER TABLE table_name AUTO_INCREMENT=10
This will reset the next auto increment value to current largest value in the auto increment column + 1. That way the auto increment will start with 10 instead of 11.
Auto expand columns Finder‘s column view
Posted on Tuesday 19 January 2010
Finder normally doesn‘t remember the width when you double click the column width button. This can be frustrating when you‘re filenames are usually pretty long. There‘s a solution to this. Just press the option key(alt) and drag to the desired width. This expands all the columns to the same size and remembers the width for the next time you open up your Finder window.

MySQL replace function - Find and replace values in database with sql
Posted on Tuesday 12 January 2010
A great piece of sql that can save you a lot of time. The replace sql function finds and replaces values in a database.
Just fill in the table_name, table_field, the value your searching for and with which value you want to replace it with.
UPDATE table_name SET table_field = REPLACE(table_field, 'value', 'new_value') WHERE my_field LIKE '%value%';
Remove the index.php from your codeigniter URL
Posted on Sunday 19 July 2009

When you create a standard new codeigniter application, there’s always a index.php in your url. It’s kind of ugly in your url so I prefer to remove this. To remove this you need to do a couple of things:
change the $config[‘index_page’] to $config[‘index_page’]=”“ instead of $config[‘index_page’]=“index.php”
Next create a .htaccess file in the root of your CI application with the following:
RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond % !-f
RewriteCond % !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]