javascript; Auto-highlight on focus

Sometimes I look online for code and when I find it I realize that I should have known how to do it. Then I feel silly. This is a time when that happened.

I needed to auto-highlight the contents of a read-only textbox or textarea when the user clicked on the input.  Easiest javascript I’ve implemented today!

StackOverflow answer…..

<input type="text" name="textbox" value="Test" onclick="this.select()" />

#VisualStudio Shortcut Keys – Open File in Solution Explorer

Solution-ExplorerWhen working in an application as complex as Visual Studio it becomes necessary to learn the shortcut keys.  Some of them are used so much that the keys get hit with no thought at all.  Then there are those few that are necessary for doing things, like efficient navigation of large projects, but are used so rarely that they are easily forgotten.  One of these is the “Sync With Active Document” (Ctrl+[, S) command.  Opens the Solution Explorer and navigates directly to the file that you are looking at.

 

Visual Studio: Navigating large files

I am often working in Visual Studio in Controllers that have a large amount of code in them and want to look at code from multiple parts of the file. Using the split screen view is not sufficient.  The following is how I maximize my monitor space to get the best experience with the fewest distractions.

1. Select the tab you are working with.
2. Select Window -> New Window
3. Select Window -> New Vertical Tab Group
4. Press Shift – Alt – Enter to switch to full screen mode.

Lazy Programming: The Three Virtues

Three Virtues

According to Larry Wall, the original author of the Perl
programming language, there are three great virtues of a programmer; Laziness, Impatience and Hubris

  1. Laziness: The quality that makes you go to great effort to
    reduce overall energy expenditure. It makes you write labor-saving
    programs that other people will find useful and document what you
    wrote so you don’t have to answer so many questions about it.
  2. Impatience: The anger you feel when the computer is being
    lazy. This makes you write programs that don’t just react to your
    needs, but actually anticipate them. Or at least pretend to.
  3. Hubris: The quality that makes you write (and maintain)
    programs that other people won’t want to say bad things about.

via Laziness Impatience Hubris.

ReSharper, getting started again

Years ago I used to use ReSharper on a daily basis. Then I left that company and didn’t have easy access to it any more. I missed it. I finally am at a place where I have a copy again. I am in the process of relearning how to use it. Here are a few linking that I found useful:

1. This is ReSharpers PDF file the most used shortcuts
2. Pluralsights “ReSharper Fundamentals” course
3. 24 + 3 ReSharper tips by Rapid Application Development blog
4. A Code Project article with more detailed examples
5. ReSharper documentation of the various functionality