Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Leandro Ardissone http://www.ardissone.org/

« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS 

show images in web directory list

I was tired of found lots of images in a directory, and click in each one to see if someone of these are really cool are soooo dirty.

I wrote this bookmarklet, that create a new document with all the images opened in a table.
NSF56k but nice.

javascript:function showallimagesindirectory(){var s='test';var dc='<b>Images in: '+location.href+'</b><table border=1 style=\'font:x-small verdana\'>';for(var i=0;i<document.links.length;i++){s=document.links[i].href;if(s.toUpperCase().lastIndexOf('.JPG')!=-1 || s.toUpperCase().lastIndexOf('.JPEG')!=-1 || s.toUpperCase().lastIndexOf('.GIF')!=-1 || s.toUpperCase().lastIndexOf('.PNG')!=-1){dc+='<tr>';dc+='<td><img src='+s+'>&nbsp;</td>';dc+='</tr>';}}dc+='</table>';var iw=window.open('','iw','');iw.document.open();iw.document.write(dc);iw.document.close();}showallimagesindirectory();


enjoy!

go to specific del.icio.us tags directly

This is a bookmarklet i've wrote to quickly go to specific tag from people on del.icio.us.

In example you want to go to http://del.icio.us/tag/games
just click bookmarklet, write "games" and let's go!

javascript:(function(){javascript:var i=prompt('Tag?');if(i)document.location='http://del.icio.us/tag/'+i;})();


enjoy!

Use mod_gzip in your PHP files

This single line allows you to use the mod_gzip Apache module (only if installed) to save bandwidth compressing the content to send.

<? ob_start("ob_gzhandler"); ?>

Images Preloader

// Image Preloader  v1.0.1
// documentation: http://www.dithered.com/javascript/image_preloader/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)


function preloadImages() {
   if (document.images) {
      for (var i = 0; i < preloadImages.arguments.length; i++) {
         (new Image()).src = preloadImages.arguments[i];
      }
   }
}
« Newer Snippets
Older Snippets »
Showing 1-4 of 4 total  RSS