Friday, May 30, 2008

A couple of handy cheat sheets

I use both of these on a regular basis. I've printed them out on paper, so they're always withing arms reach.

Domino URL cheat sheet

Domino supported syntax for Full Text searching

For web development, ILoveJackDaniels.com has a few nice ones (the site seems to be down at the moment).

Monday, May 26, 2008

Upcoming experiment - Beautiful URLs with Domino



Just a little preview.. It's a simple "hack". No admins involved :)

More info about well designed URLs

Wednesday, May 14, 2008

StrToken/@Word in JavaScript


function strToken( string, separator, position ){
//If the string doesn't contain the separator, return
//empty string
if( string.indexOf( separator ) == -1 ){ return ''; }

var arr = string.split( separator );

//If the position is larger than the number of elements,
//return empty string
if( position > arr.length ){ return ''; }

//Return found item
return arr[ position - 1 ];
}



Tested in IE6/FF2

Thursday, May 8, 2008

@Unique in Javascript

Update, 16.06.09: As Ronaldo points out, this doesn't work in IE6, as it doesn't have the Array.indexOf-method (I probably tested the function in a Prototype JS-enviroment). To make the function work for browsers that doesn't have the aforementioned method:
if(!Array.indexOf){
Array.prototype.indexOf = function(obj){
for( var i = 0, len = this.length; i < len; i++){
if(this[i]==obj){
return i;
}
}
return -1;
}
}




function arrayUnique( array ){
var uniqueArray = [];

var item;
for( var i = 0, len=array.length ; i < len ; i++ ){
item = array[i];
if( uniqueArray.indexOf( item ) == -1 ){
uniqueArray.push( item );
}
}

return uniqueArray;
}



Tested in IE6/FF2