Below are the top ranked snippets.
13
Trim , Left trim (ltrim) and Right Trim (rtrim) in javascript
13
It works with Array types. The example is a simple list of numbers, but the array could contain anything; lists of strings, functions, DOM nodes, whatever. Unfortunately, a lot of things that seem like arrays in the DOM aren't really, so you can't shuffle the images on a page with just document.images.shuffle() all by itself.
13
If you're an IE user you may have noticed that when you hover on a medium to large sized image, a toolbar appears in the corner of the image. It's basically useless as it accomplishes nothing that can't be done with a right-click.
Luckily, Microsoft has included a way for webmasters to disable this function.
Luckily, Microsoft has included a way for webmasters to disable this function.
13
Creates one of those neat Web 2.0-like tag clouds!
13
Recursively checks for all *.php and *.tpl files in the directory specified (or the current directory if one is not specified) and runs `php -l $file`. Only outputs the errors.
13
Pagination Class , I think everyone knew now what's it does and means
NT: This class written by my friend have phun!
NT: This class written by my friend have phun!
13
daysBeteenDates will calculate the number of days between 2 dates in the form of 'YYYY-MM-DD'.
13
This is a simple function that resizes and image using the GD add on for PHP.
Just a disclaimer: I know its not perfect, but i figured i would post it because the only other one on here is way confusing to some new PHP developers. Hopefully this one will help you learn how to use GD, and then you can write a better one.
Just a disclaimer: I know its not perfect, but i figured i would post it because the only other one on here is way confusing to some new PHP developers. Hopefully this one will help you learn how to use GD, and then you can write a better one.
12
If you have ever written a website or java application where people paste stuff in from Word, you are likely to have hit the problem of Word using high ascii chars for "open quotes", "close quotes", reg symbol, etc...
This java class (with a single static method) can replace the most prevalent of these with normal ascii values
Hope it helps someone...
This java class (with a single static method) can replace the most prevalent of these with normal ascii values
Hope it helps someone...
12
Another solution recommends using a text match pattern.
This works, but as long as you've got mail.jar in your classpath anyway, you might as well use this technique instead. (Plus, I think it works with older JDK 1.2+, whereas pattern.compile is 1.4+)
Note that it also accepts a comma-separated list of emails, just like a To: or CC: address line would.
This works, but as long as you've got mail.jar in your classpath anyway, you might as well use this technique instead. (Plus, I think it works with older JDK 1.2+, whereas pattern.compile is 1.4+)
Note that it also accepts a comma-separated list of emails, just like a To: or CC: address line would.









