C# Extension method: Searching lines containing specific string

Searching for lines in text file containing a specific string can be very handy with below code snippet. This method is very optimal specially if we are accessing log/error/access files.

Usage:

The method can be further improvised to search lines in text files with in a directory containing the specific string.

Packet Analyzers

Packet analyzers (also known as protocol analyzer) are computer programs that can intercept and log traffic passing over a digital network or part of a network. These are very handy tool in web development & analytics as they can do post-mortem of all your Request & Response and provide you a detail information while interacting …

Some must-have & free online development tools

Below is the list of some good & free online tools that can assist you in web development in ways like validation & optimization: Front-end tools: JS Beautifier – Beautify, unpack or deobfuscate JS, HTML, JSON etc and make them readable JSON validator – help with debugging JSON and making them readable HTML Formatter – …

Open Url from Command prompt?

Thinking of scripting a way to open URL directly from command script of batch file?? Here is a cool way to open the URLs, type below rundll32 command on the prompt on Windows machine & press Enter: rundll32 url.dll, FileProtocolHandler “http://www.technowide.net” References: http://support.microsoft.com/kb/164787 Enjoy!!

Website Performance: Golden rule

Only less than 20% of overall response time is spent downloading actual HTML document; rest over 80% of time is consumed downloading components associated on the page. Strange? but its true. And if we further drill down the scenario here, we would find that the HTML generated for most of dynamic website are actually through …

Forcing IE browsers to behave properly??

You can explicitly tell IE browsers to use its latest available rendering engine using a meta tag. This also prevents IE to open Quirks mode while rending page. You need to add below meta tag at page level to accomplish this.

In above meta tag, IE=edge tells IE to use its latest rendering engine. …

Day CMS: Architecture Stack

Adobe’s Day CQ5 is based on below underlying technologies including: Apache Sling – web application framework for content-centric applications, using a JavaContent Repository, such as Apache Jackrabbit or CRX. It is based on REST principles to provide easy development of content-oriented applications. OSGi (Apache Felix) – an application framework & dynamic module system for Java …

Input type File validation – Client side

Thinking of allowing only specific file types to be browsed through File Input HTML field?? Here’ a simple regex based javascript that can help you out with the solution. It’s based on the file extension of file being browsed and clears the input field if validation fails. The allowed list of file extensions is exhaustive …