Monthly Archives: September 2009

Scriptlets

Scriptlets post to diigo javascript:(function() {var url = location.href;var title = document.title || url;var desc = (window.getSelection ? window.getSelection().toString() : document.getSelection ? document.getSelection()  : document.selection.createRange().text);window.location.href = ‘http://www.diigo.com/post?url=’ + encodeURIComponent(url) + ‘&title=’ + encodeURIComponent(title) + ‘&desc=’ + encodeURIComponent(desc)})(); Diigolet javascript:(function(){s=document.createElement("script");s.type="text/javascript";s.src="http://www.diigo.com/javascripts/webtoolbar/diigolet_b_h_b.js";document.body.appendChild(s);})(); Delicious … Continue reading

Posted in Code Snippets | Leave a comment

syscomments

syscomments SELECT –c.id, c.text o.id,number,refdate,xtype,name,text FROM syscomments c INNER JOIN sysobjects o ON c.id = o.id

Posted in SQL Server 2005 | Leave a comment

TSQL – table row count using sysindexes or DMV

Row Counts Using sysindexes  (SQL 2000) — Shows all user tables and row counts for the current database — Remove OBJECTPROPERTY function call to include system objects SELECT o.NAME, i.rowcnt FROM sysindexes AS i INNER JOIN sysobjects AS o ON i.id … Continue reading

Posted in SQL Server 2005 | Leave a comment

TSQL – Loop through records without using a cursor

declare @devip varchar(15) select distinct devip into #1 from table1 set @devip=” while @devip is not null begin    select @devip=min(devip) from #1 where devip>@devip    print @devip    — do something with @devip end drop table #1

Posted in SQL Server 2005 | Leave a comment

Create Photo Montage with ImageMagick

montage -geometry +12+12 -tile 4×4 2008*.jpg montage.jpg montage 2008*.jpg -thumbnail 300×300 -set caption %t -bordercolor #E6E6FA -background grey40 -pointsize 9 -density 144×144 +polaroid -resize 50% -background white -geometry +1+1 -tile 4×4 -title "Las Vegas Travel 2008" polaroid_t.jpg

Posted in Uncategorized | Leave a comment

imagemagick – mogrify – batch resize images

Batch Resize Images Using Imagemagick Resize to 640×480 (maximum width and height), keep the aspect ratio mogrify -resize 640×480 *.jpg Resize to fixed width of 640, keep the aspect ratio mogrify -resize 640 *.jpg Resize to fixed height of 480, … Continue reading

Posted in Code Snippets | Leave a comment

regexp samples

– <a id="item_(\d+)_0.*\s*href="(.*)"></a> match: <a id="item_51_0" href="d/569-5/IMG_6581.JPG"></a>   http://www.gskinner.com/RegExr/

Posted in Code Snippets | Leave a comment