By Firoz AnsariJune 12, 20191 min readComments (0)

There is, unfortunately, no shortcut key available to toggle between showing and hiding files or folder in the File Explorer. Hence this AutoHotKey script. You can toggle the view in File Explorer to show or hide with the just a Win+h shortcut key.

This script is not that fancy, it just toggles between two different values of the specific registry key and will send F5 keystroke to refresh the view in File Explorer.

SetTitleMatchMode, 2
#IfWinActive ahk_class CabinetWClass
  RegRead, HiddenRegValue, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden

  if HiddenRegValue = 2 
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2

  WinGetClass, CabinetWClass
  Send {F5}

If you don't prefer the above script, you can still toggle hidden items with the combination of multiple keystrokes in File Explorer. The key combination is Alt+v hh.

By Firoz AnsariJune 07, 20191 min readComments (0)

This little AutoHotKey snippet will make copying rich text and pasting as clean text a bit less hassle:

  clipboard := ClipboardAll ;Copy clipboard contents to a variable
  Clipboard = %clipboard% ;Save content of the variable back to the clipboard
  Send ^v ;Send Ctrl+V command

The assigned shortcut key is Ctrl+Shift+V, which you can change per your preference. Copy any rich text from a web site, open word document or new email in Outlook and press Ctrl+Shift+V. AutoHotKey snippet will remove all style formattings and will paste just the clean text.

By Firoz AnsariMay 21, 20192 min readComment (1)

It's in our muscle memory. Press Ctrl+F in your favorite text editor to find something, provide find criteria, and hit the Find button. As always, we usually stick with the simple Find functionality of the text editor as it serves almost all of our basic search needs. But beneath Find dialog box, there is a powerful Find option, Use Regular Expressions which most seldom use.

Visual Studio 2019 - Find in Files

Able to recall a correct regular expression when we need it most is rare. Which often leads to the hassle of googling regular expression and trying few failed attempts, and going back to simple Find. This is where following regular expressions cheatsheet comes handy for me.

Regular Expressions:

  • Have foo anywhere and bar later in the same line
  • Have foo at the beginning of the line
  • Have foo at the beginning of the line and bar later in the same line
  • Have foo in the commentted line
  • Have foo inside double quotes
  • Have foo at the beginning or end of the word
  • Have foo at the end of the line
  • Have foo); at the end of the line
  • Have foo but not bar in the same line
  • Have foo and { in the next line
By Firoz AnsariMay 10, 20191 min readComments (0)
EXEC sp_msforeachdb 'USE ?; IF EXISTS(SELECT 1 FROM [?].sys.objects WHERE name=''<<SP NAME>>'') PRINT DB_NAME() '

-- Example:
EXEC sp_msforeachdb 'USE ?; IF EXISTS(SELECT 1 FROM [?].sys.objects WHERE name=''usp_CommentTree'') PRINT DB_NAME() '
By Firoz AnsariMay 05, 20191 min readComments (0)

Unfortunately there is no method to call DataTable.Add with the column size. This extension method will fix that:

public static DataColumn Add(this DataColumnCollection columns, string columnName, Type type, int maxLength)
  DataColumn column = new DataColumn(columnName, type);
  column.MaxLength = maxLength;

  return column;
By Firoz AnsariApril 02, 20081 min readComments (0)

You can easily scroll to the top of the webpage by just tapping on the top bar ( the bar which has icons like signal status, carrier name, time etc.) of iPhone but how about scrolling to the bottom of the page? If you are browsing very long web page then sometimes it becomes a bit annoying to scroll through the whole page to get the bottom of the page. But here is a small Javascript hack, through which allow you to scroll to the bottom of the page with just one tab. You just require adding this Javascript code as a bookmarklet (or sometimes it also called Favelet):

Javascript Code:

javascript:(function(){scroll(0, document.body.scrollHeight);})();

[Scroll Bottom](javascript:(function(){scroll(0, document.body.scrollHeight);})();)

To add Scroll Bottom bookmarklet, just drag above link to Safari Bookmarks Bar and then sync to your iPhone through iTunes.

Following are some relative articles for bookmarks and syncing to the iPhone:

Syncing iPhone and iPod touch with your computer
iPhone: Using Bookmarks
17 powerful bookmarklets for your iPhone

Copyright © 2021 Firoz Ansari.
All Rights Reserved.