Easily embed Flash movies and make them viewable fullscreen with jQuery and SWFobject

Posted on Wednesday 27 January 2010

I wrote a little jQuery script that makes embedding flash movies very easy and makes them go fullscreen when you click a link. I used jQuery swfobject to load in the movies and jQuery to make it go fullscreen. I import the flash videos in a div and set the div’s width and height to 100%. This flash div is outside of a container div. When I make the flash div go fullscreen, I set the display of the container div to none. 

Supported browsers: 
Internet Explorer 5.5/6.0/7.0/8.0
FireFox 1.5/2.0
Safari 2.0
Opera 9.0

Read more →

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”)

Read more →

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,
...
});

Read more →

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.

Read more →

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.

Auto expland column Finder

Read more →

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%';

Read more →