var value = $.trim($(this).val()); if ($(this).hasClass(invalidClass)) ...
JavaScript jQuery script: too many ifs...
This is part of a jQuery pl...
function encodeHTML(html)
{
encoded = encodeURI(html);
...
JavaScript Escape HTML
by Nathan,
March 31, 2010 13:48,
2 refactorings
All HTML special characters...
this.rotate = function (antiClockwise)
{
if (antiClockwise)
...
JavaScript Rotate co-ordinates
A nice and fun one here. I ...
JavaScript On Search a string with wildcards
by Nathan,
March 03, 2010 06:54
Thanks for that DPM. I had ...
function matches(matchString,list) ...
JavaScript Search a string with wildcards
by Nathan,
March 03, 2010 00:48,
5 refactorings
I want to have a string whi...
rightOffset = 20;
topOffset = 20;
...
JavaScript Center text along a sloping...
by Nathan,
February 26, 2010 23:46,
1 refactoring
I've written a countdown to...
function changeColours(headerClassColour,contentClassColour,bannerDivColour)
{
document.getElementById("content").className = contentClassColour + "-content";
...
JavaScript Colour changer
by Nathan,
February 19, 2010 13:55,
2 refactorings
Intended to give a create a...
<?php
function get_title($html_page)
{
...
PHP Get Title of HTML page
Extract and return the bits...
<?php
function get_handle($type='!') // $type set to something invalid, so that user explicitly has to declare it.
{
...
PHP On Return the appropriate file...
by Nathan,
February 09, 2010 10:17
Thanks for that. It does ma...
<?php
function get_handle($type)
{
...
PHP Return the appropriate file...
This method feels like it's...
VB.NET On Many-to-many list box inter...
by Nathan,
February 03, 2010 11:16
Oh, should have said its in...
Private Sub cmdAddAmbassador_Click() ' Run when the user clicks the "<" button to add an ambassador to an event ...
VB.NET Many-to-many list box inter...
VBA, not VB.NET.
This is...
#!/bin/ruby characters_to_use="ABCD" ...
Ruby brute-force password cracker
by Nathan,
October 10, 2008 22:29,
5 refactorings, tagged with password, brute-force, crack, combination, permutation
Just a quick-and-dirty for ...
Some selected URLs exist wh...