I love ViM. I use it for a lot of coding – especially non-project-based coding like creating or modifying PowerShell scripts. It’s also great for diagnosing log files or just a general purpose vanilla text editor/viewer with powerful regular expression search capabilities.
A common pattern of use is to open large minified XML files – like a Burn bundle manifest (which for Visual Studio 2012 is huge). Parsing all that information as a single line is a daunting task – one made more simple by formatting (indenting) the XML. I had a way that involved opening the file in another editor, formatting it, then saving it. But then I stumbled across another tip that inspired the following 2 commands that do all this in ViM:
This uses the default indentation ( :help c-indenting ) shipped with the main ViM distribution and works great for XML. It even provide progress by counting down the lines left to process.
Many times – mainly when writing function cmdlets for other purposes – I find that I need to output all unique objects based on one or two properties but want all the objects’ properties returned. PowerShell’s built-in Select-Object doesn’t let me do that. Apart from enumerating and collecting all objects before outputing them to the pipeline, it only return the properties that you specified.
To let all the objects flow through the pipeline as they are enumerating, I added my own Select-Unique cmdlet to my $profile a couple of years ago but wanted to share it now as a Gist.
See the comments on the gist for more information.
For various reasons I’ve started splitting my archive folders into separate files separate by date. There is a fairly simple object model for Microsoft Outlook and utilizing built-in search in 2010 this would be even easier to write my own program, but being a pragmatic programmer I figured I’d see if anyone else has done this. There is many applications out there, but some were for-pay and none came from sites with which I was familiar.
Then I found buried in Outlook a way to archive even the archive folders with the ability to do so by date.
- Open Microsoft Outlook 2010 if not already open.
- Optional: Clean up archive folders to reduce size and decrease the time to process (see below).
- Click on File.
- Click on Cleanup Tools, then Archive….
- Scroll down and select “Archive Folders”.
- Set the date for which older items are moved into a new folder.
- Set the location for the new archive PST file.
- Click OK.
When complete, the archive PST is attached to your Outlook profile and will be indexed.
The optional step is clean up each folder before splitting your PST. I do this every month or so on my current folders as well before they are archived to reduce the active archive PST as well (too bad the Auto Archive settings don’t allow for this). While this is supposed to work on sub-folders, it has not seemed to work for me. So to clean up each folder,
- Select the folder to open it.
- Right click on that same folder and select Clean Up Folder.
Hopefully this tip helps you split PST files by date easily and freely.
I’ve been doing research into home automation through UPnP lately (the underlying technology for DLNA devices). One nice thing about UPnP devices is that they are easy to communicate with (when you have an implementation that allows for it) and appear in Windows Network Explorer. If you have an Internet gateway (router) or an Xbox 360, for example, you’ll see these devices appear in network explorer. This is UPnP behind the scenes.
A cool little customization I discovered was how to customize icons, verbs, and other shell extensions for different device types. A device URN describes the device type, and would look something like “urn:schemas-upnp-org:device:DimmableLight:1” (dimmable light). Using the device URN, you can add a registry key in Windows to customize for that device type.
- @ = Path, index to icon
- Shell handlers
The types of shell extensions supported are at least context menu and property sheet extensions, as evident from Internet gateway devices (IGDs).
Tired of your laptop sleeping on the job whenever you walk away for a short while? Give it a shot of caffeine!
Caffeine is a small utility application written on top of the Windows Presentation Foundation that allows you to keep your monitor and/or system awake. It does not disable your screensaver, nor prevent your system from sleeping when you force it – like when you close the lid – so you’re in complete control. You do not need to change your power options – which you may forget to revert later. Just run the application and click whether you want to keep your display, system, or both awake. When you quit the application it remembers your settings and allows your system to sleep as configured again.
So give your system a shot of caffeine today and keep it working all night too!
This is a sample application I wrote and published as a helpful utility I’ve needed quite a few times. Baristas, obscure indie music, and free wi-fi not included.
If I hear someone else gloat over their new cool Windows Phone 7 device and flash it in my face, I’m likely to scream, grab it, and run. Yes, it’s a great device that fits nicely between the form and function of iPhone (minimum set of hardware requirements, which works great for developers) and the availability on different hardware as Android (or Windows Mobile) with no real requirements (and a pain for developers).
But I’m on Verizon, and no CDMA Windows Phone 7s are available yet. Sprint has announced one or two already, and Verizon seems they will get an HTC sometime next year (after Sprint, since Verizon apparently takes longer to test devices).
So dear friends and colleagues, be happy with your device but when you show how cool it is to me, make sure you hold on tight!