Coding

jQuery: $(document).ready(function(){…}) vs $(window).bind(’load’, function(){…})

Wednesday, December 9th, 2009 | Coding, Tips & Tricks, jQuery | 24 Comments

The $(document).ready(function(){…}) is great and I always use it. It gets called after all the page elements are loaded, which means that all your input boxes, img, etc are there by the time you execute your javascript. Up until today I didn’t need anything else… › Continue reading

Quick tip: Debugging CakePHP on a live site

Wednesday, July 22nd, 2009 | CakePHP, Coding, Tips & Tricks | No Comments

As all web developers know, you don’t want site visitors to ever see your sql queries or any debugging information. So wat do you do when you need to debug on a high traffic live site?

› Continue reading

Getting a random row from MySQL

Sunday, July 12th, 2009 | Coding, Tips & Tricks | 105 Comments

Getting a random row from a MySQL query is actually pretty easy. When doing a query like.
SELECT * FROM entries WHERE name = "Moe"
You can get a randomized selection of rows by adding RAND() to your ORDER BY clause. Your query would look something like:
SELECT * FROM entries WHERE name = "Moe" ORDER BY RAND()

› Continue reading

Online Lorem Ipsum Generator

Monday, August 25th, 2008 | Coding, Tips & Tricks | 2 Comments

lipsum.com is a website dedicated to Lorem Ipsum, the placeholder text used by the printing industry.

Website and document prototypes look better when they are filled with realistic text, which is where lipsum.com’s Lorem Ipsum generator comes in. If you specify an amount of paragraphs, words, bytes or list, it will generate some dummy text for you to use:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer ut massa nec sapien ullamcorper rutrum. Nullam sagittis orci vitae diam. Maecenas consequat ante ac magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque laoreet ipsum pellentesque nulla dignissim malesuada. Proin ultrices, ante pellentesque iaculis laoreet, augue felis feugiat quam, eget tincidunt justo dolor id nisl. Nulla in felis eu nisi eleifend fermentum. Donec placerat libero a quam. Aenean a nibh id nibh congue aliquam. Vivamus pulvinar congue pede. Sed vitae tortor.

 

They also have a very informative section on the history of Lorem Ipsum. I was always under the impression that it was just randomized text, but apparently:

“It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of ‘de Finibus Bonorum et Malorum’ (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.”

Tags: , , , , , , ,

Smashing Magazine’s Top 10 CSS Table Designs

Thursday, August 21st, 2008 | Coding | 1 Comment

Smashing Magazine recently posted an article about the Top 10 Table Designs that can be done with CSS:

Horizontal Minimalist

Horizontal Minimalist

Vertical Minimalist

Vertical Minimalist

Box

Box

Horizontal Zebra

Horizontal Zebra

Vertical Zebra

 

One Column Emphasis

One Column Emphasis

Newspaper

Newspaper

Rounded Corner

Rounded Corner

Table Background

Table Background

Cell Background

Cell Background

Tags: , , , ,

Categories

Search

Meta

Afrigator