Search For Specific Files Containing Specific Text in Linux

Here’s a cool technique I learned from a colleague during my development at work.  It basically gets a list of files from find and for each <filename>.<extension> found, searches for <search string>. You also have to option to include (exclude?) an <exclude path>. Syntax: find <start path> -name <filename>.<extension> -exec grep -li …

Detect Browser, Platform, and Touch Capability Using Javascript

Here’s a method of detecting which browser you’re using and whether you’re on a mobile or desktop platform: <script type=”text/javascript”>   <!–   var userAgent = navigator.userAgent || window.navigator.userAgent;   var nav = navigator || window.navigator;   var isDesktop = nav[‘platform’].match(/(Mac|Win|Linux)/) && !userAgent.match(/Android/);   if (isDesktop) {     alert(“You’re on a Desktop!”);   };   –> </script> Need …

MSSQL 2005 Dynamic PIVOT

Here’s a method of generating a dynamic pivot of a dataset. It first generates the columns as a string (“[ColumnHeader0],[ColumnHeader1],[ColumnHeader2], …” format), builds a dynamic SQL string and executes it using the PIVOT expression. From the code below, the @cols variable is generated by using the FOR XML PATH expression. …