Tuesday, 30 June 2009

Cleaning Notification Area Icons in Vista/Windows 7

Just thought I would quickly post a little tip on how to clean your notification items from Windows Vista/7..

What are Notification Area Icons?

imageIn Vista/7 you have the ability to control how items in the taskbar tray are displayed (hidden, always shown etc).

This list can actually get rather bloated, especially for us developers when we are building applications that sit in the tray (you actually end up getting two entries, one for the debug, one for the release). So, you may find it is getting a bit unmanageable and want to give it a clean.

NOTE: This will remove ALL entries from the list – including settings you may/will want to keep!

You will therefore need to reconfigure items that you want to always show in the tray etc.

Some people may be asking “why not just use the reset link provided?” – Well, it doesn’t clean, it just resets. So if you have many icons that you have previously set to “Always Show” and then deleted. They will just revert back to “Hide/Only Show Notifications” (or whatever) as opposed to actually being removed from the list.

(If at this point you are still unsure what Notification Area Icons are or how they affect your system – this blog post may not be for you).

So How Do I Do It?

Pretty simple, just execute this registry script:

   1: [HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify]
   2: "PromotedIconCache"=-
   3: "PastIconsStream"=-
   4: "IconStreams"=-

imageThis will basically blitz the cached items in Explorer. We then need to restart this process so open Task Manager (CTRL + SHIFT + ESC) right-click explorer and click “End Process”. Don’t panic, the taskbar etc is supposed to disappear, that’s the point :)

Then in Task Manager, click “File > New Task (Run…)” and then enter “explorer.exe” and all will return to normal. Note your Tray Icon/Notification settings are now squeaky clean!

Hope this helps :)

Monday, 22 June 2009

GrokGit Series: “Gitting Started with Git”

Well, I have been saying it for a while – I need to do more speaking at community events, so I finally agreed to start small and do a nugget for my local user group.

Why Speaking?

My thoughts are simply:

Pros

  • You need to understand things more intimately in order to be able to explain them.
  • The many iterations required to get the slides right reinforces the learning that took place to get the content on there to being with.
  • It’s great for confidence.
  • You can (hopefully) pass some useful knowledge on to the community and help them try new things/better themselves.
  • It’s a great icebreaker to meet new people (i.e. you are more likely to talk and engage with them if you have some subject matter to talk about).

Cons

  • It can be scary – it’s been ages since I stood up in front of people.
  • It can be time consuming trying to create the “perfect” slide deck.
  • You can look/sound like an ass.
  • You give false information and/or confuse people even more.

… All of which can be sorted by me trying hard not to be a moron (no guarantees, no cash back!) :)

OK, So What Nugget?

I have recently decided to take more of a direct approach at getting to grips with Git. After a rather interesting session at Open Space Code in London, I came back highly motivated to crack it.

Since myself and others have experienced some pain at most parts of the learning process, I thought I would share some tips and guidance on how to get up and running with Git.

This nugget is the first of a series I hope to continue to help both you guys and myself get to grips with Git.

Please click the link below to download the slides from my SkyDrive.

I’ll upload others as soon as I have completed the talks (give me a change to review them based on feedback etc.)

As always, all feedback is very welcome – so please shout if you see anything you feel needs to be said!

Tuesday, 9 June 2009

Common Git Commands Reference/Getting Started

Here’s a round up of the main features that I have made use of in getting started with Git. This is by no means a complete list, but I thought it could be a great supplement to any “Getting Started” guide you may have (feel free to comment and post links!).

Basic Commands

Here’s a run-down of the most common commands I have found myself using.

Command Description

git help commandName

REALLY your friend when getting started! Use it!

git init

Creates a Git repository in the current directory.

git status

Reports the current repository status (e.g. commits pending etc.)

git add

Add files to source control (use the “-A” switch for ALL files in the directory.

git commit

Performs a commit operation to the current repository.

git branch

Lists the branches in the repository (with the current branch marked with an asterisk).

git branch name

Create a new branch called with the given name. This will be created based on the HEAD revision of the master (i.e. latest code).

git branch -d

Deletes a merged branch. If you wish to delete a branch regardless of it’s merged status, use “-D” instead.

git checkout branchName

Change the working tree to the given branch name.

git checkout –b newBranchName

Creates a new branch with the given name and switches it to the working tree.

git log

Lists the log messages for the current branch.

git gui

Pretty nice, simple GUI for a more visual run-down of the current Git state.

git reset --hard

Reverts the working tree back to HEAD revision (useful for messing with code and not wanting to commit).

Ignoring Files & File Types

I found the best (and easiest way) to do this is to create a text file that contains the ignore patterns you would like to add. For example:

   1: # Core Excludes for Git
   2: # Cached items used by VS.
   3: obj/
   4: bin/
   5:  
   6: # Resharper Cache
   7: _ReSharper.*/
   8: *.resharper.user

Once we have created the file, we then need to tell Git to use that file for its exclude configuration. We do this using the “git config” command to set the environment variable “core.excludesfile” like so:

   1: git config core.excludesfile {path}

While working with the excludes file you will probably want to test that your patterns are matching correctly. This is where “dry run” will be your friend. When you have added your excludes file to your configuration, flick back to your project and type:

   1: git add –A –-dry-run

Here we are telling git to add all the files in the project directory (using the “-A” switch) but we have also specified it is a dry run (note the double-dashes preceding dry). This will basically list all the files that would be added if you had not have specified “--dry-run”.

Now, if you are anything like me, your first pattern may not be right. So you will go back and update the excludes file, save and then try again.

But wait, there is no difference to what is matched? It would appear that Git stores the configuration in memory once loaded (makes sense) so we need to reset it. Simply re-execute the “git config core.excludes {path}” command again and all will be well.

One other point to note, patterns are case-sensitive… That one had me for a good five minutes.. :)

Wrap Up

It is very likely that this post will continue to grow as I come across new commands/processes etc. So it may be one to fave in the RSS reader if you have found it useful.

If you have any ideas/suggestions for other items to add to the list, please let me know!

Obviously I have not covered merging yet, but that is the next on the list. I do also intend to add working with remote repositories (for those wanting to use GitHub) soon, so check back for that!