Duplicate table with MySQL

Posted on Monday 27 September 2010

Just replace the new_table with the name of your new table and existing_table with the table you want to duplicate

CREATE TABLE new_table SELECT * FROM existing_table

Read more →

Array with a list of European countries

Posted on Monday 13 September 2010

This is a list of all the European countries put into an array:

$eu_countries = array(
“Albania”,
“Andorra”,
“Armenia”,
“Austria”,
“Azerbaijan”,
“Belarus”,
“Belgium”,
“Bosnia and Herzegovina”,
“Bulgaria”,
“Croatia”,
....

Read more →

Ipad detection with PHP and htaccess

Posted on Thursday 19 August 2010

This wil return a 1 value if it’s an iPad:

$ipad_or_not = (bool) strpos($_SERVER[‘HTTP_USER_AGENT’],‘iPad’);

 

You also can redirect with htaccess:

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$

RewriteRule ^(.*)$ http://ipad.yourdomain.com [R=301]

Read more →

Deselect all options in dropdown with jQuery

Posted on Monday 7 June 2010

Here's how you deselect all the values in a dropdown with jQuery

$("#dropdown").each(function(){
$("#dropdown").removeAttr("selected");
});

Read more →

Most used Social media share links (facebook, twitter, linkedin, Stuble upon)

Posted on Saturday 22 May 2010

As sharing content with other people becomes more and more common in every day web development I mainly just use these share links. I always seem to forget how to form them, so here they are:

 FACEBOOK

http://www.facebook.com/sharer.php?u=http://stevendobbelaere.be&t=test 

Share

 TWITTER

http:/twitter.com/home?status=Currently reading http://stevendobbelaere.be

  LINKEDIN

http://www.linkedin.com/shareArticle?summary=Web development blog&title=Currently reading http://stevendobbelaere.be&mini=true&url=http://stevendobbelaere.be&source=http://stevendobbelaere.be

Share

 STUMBLE UPON

http://www.stumbleupon.com/submit?url=http://www.stevendobbelaere.be&title=Steven+dobbelaere

Share

 MAILTO

mailto:info@stevendobbelaere.be?subject=this is the subject&body=this is the body

Share

Read more →

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 →