Below are the top ranked snippets.

ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

« Previous 1 2 3 4 5 6 7 8 9  ...  62 63 Next »
16
Date Submitted Thu. Mar. 1st, 2007 2:09 PM
Revision 1
Helper ushi
Tags ajax | Chat | JavaScript | PHP
Comments 3 comments
Simple chatting script to be placed on a corner of a website
Also a good example how to use ajax.
16
Date Submitted Wed. Mar. 22nd, 2006 6:10 PM
Revision 2
Beginner nev3rm0re
Tags PHP | String
Comments 1 comments
This function calculates how many lines will text occupy.
Example (simple):


$string = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus tincidunt posuere dolor";

$num_lines = how_many_lines(10, $string);

It accepts a third, optional, parameter $options, that allows you to change behaviour. $options should be array. Following configuration options are available:

'white_spaces' - default: array(' ', "\t") - array of chars, that should be treated as whitespace.

'new_lines' - default: array("\r\n", "\n") - array of strings, that should be treated as newlines. For example, for HTML you can set 'new_lines' => array('');

'force_line_breaks' - default: true - force wrapping, when the token is longer than width, or not. If set to false, and token cannot be fitted into $width, function will return false;

'callback' - default: null - callback function for determining character width. Must accept at least one parameter - $char

'callback_params' - default: array() - optional additional callback parameters

'char_widths' - default: null - associative array in a form $char => $width, which contains char width. If $char is not found in the array, it's width is defaulted to 0.

16
Date Submitted Mon. Oct. 10th, 2005 10:18 AM
Revision 1
Coder mattrmiller
Tags Extension | File | PHP
Comments 1 comments
Get File Extensio
16
Date Submitted Mon. Oct. 10th, 2005 11:05 AM
Revision 1
Coder mattrmiller
Tags HTML | PHP | String | Strip
Comments 2 comments
Strip HTML
16
Date Submitted Fri. Aug. 4th, 2006 10:03 AM
Revision 1
Syntax Master sundaramkumar
Tags firefox | JavaScript
Comments 0 comments
List all plugins installed in FF
15
Date Submitted Sun. Jan. 28th, 2007 1:18 PM
Revision 1
Scripter Fordiman
Tags JavaScript | json | sort
Comments 0 comments
Flexible sorting algorithm based on Quicksort with extra functionality, such as:
- Direction (ie: ascending or descending)
- Sort-by-path (eg: item.name, item.name.firstName or item[5])
- Sorting function (returns true if two items are already sorted)
- Type checking
- All constants and support functions are members of the Sort() function
- Testsuite with hooks for cscript and in-browser javascript, so you can tweak and optimize, and make sure it still works
- Environment agnostic (can use with, say, SpiderMonkey or .Net's jsc)
15
Date Submitted Fri. Jan. 19th, 2007 2:37 PM
Revision 1
Helper inxilpro
Tags "word list" | Generator | Password | PHP | Random
Comments 0 comments
This is a random password generator that produces understandable passwords based on word lists. I've only included a 3 entry world list because you should chose a list based on your password requirements and your users. If you need to generate passwords that are 14 characters in length, you will want a different list than if you're generating 8 character passwords. And depending on your users, you may want to use certain lists. The list I use is about 4000 words that are 5-7 characters long, all well-known words that have had potentially objectionable content removed. For security reasons I don't want to include this list.

A note on security: though this generates relatively strong passwords for the average user, they are particularly susceptible to brute-force attacks. This is even more an issue if somehow your word list gets compromised. I would not recommend using this function for anything where a highly secure password is needed.

A note on choosing your list: You'll also see that I've built the system to avoid generating passwords with zeros and ones in them. This is because zero and upper-case "o" can be confused as can one, lower-case "L" and upper-case "i." When choosing my word list I was also sure to strip out all words that start with the letter "o" or "i" (to prevent the optional ucfirst() from creating 0/O and I/1 confusion) and words that contain the letter "L" (to prevent l/1 confusion). I find that this greatly helps with preventing confusion, but again weakens the security of the passwords some. It's your choice.
15
Date Submitted Thu. Mar. 1st, 2007 3:48 PM
Revision 1
Helper mjlintz
Tags PHP
Comments 5 comments
Display contents of a folder, see comments in code.
15
Date Submitted Tue. Nov. 8th, 2005 11:45 AM
Revision 1
Beginner wwb
Tags CSharp | Generation | RSS
Comments 0 comments
RSS Generation Classes
15
Date Submitted Wed. Nov. 9th, 2005 8:27 PM
Revision 1
Beginner vinnie
Tags Attribute | CSS
Comments 1 comments
Attribute Selectors
« Previous 1 2 3 4 5 6 7 8 9  ...  62 63 Next »