Tuesday, February 19, 2013

LESS is more

If you're a Visual Studio web developer and you haven't tried out the Web Essentials extension by Mads Kristensen, then GO NOW, GET IT!

And for those who do know about it, and you were using it for it's LESS support, then you may have noticed in the last update how it was removed :( The only alternative then would appear to have been T4CSS.

But the same day I updated and saw the lack of LESS support, was the same day that I realised it's now baked into Visual Studio in the most recent ASP.NET and Web Tools 2012.2 Update.

It supports adding LESS files from the New Item dialog, and upon build will generate the CSS and minified CSS for it too. Which is obviously the reason it was removed from Web Essentials. Awesome :)

Thursday, February 14, 2013

Git tip - diff of only modified files

I was wondering how to see a diff of only those items that were modified in my Git workspace, and thanks to Stackoverflow, you can use the --diff-filter parameter:

git diff --diff-filter=M
git dt --diff-filter=M

The second one is if you use a visual diff tool. I prefer WinMerge, might do a post on my setup at some point, it's pretty simple once you know how.

Wednesday, February 13, 2013

Where'd my Visio BMPN stencils go?

For some reason, when opening up a saved Visio diagram that uses the BPMN stencils, these no longer show up in the Shapes window.

To get them back, click on More Shapes > Open Stencil... then find the Visio content directory, in my case this is C:\Program Files\Microsoft Office\Office14\Visio Content\1033, and then enter BPMN*_M.vss to show only the metric BPMN stencils. Select them all, then click Open.

I have no idea why it isn't stored with the document somehow. Apparently if you go to File > Info > Properties > Advanced Properties and then check the Save workspace option, then it should save things like this, but that's checked for me and it doesn't. Maybe because it's the Professional version and not the Premium version, but I doubt it. Sounds like a bug to me.

Thursday, February 7, 2013

Easier way to get to that hosts file

In Windows, there's a hosts file mapping IP addresses to hostnames. For some weird reason, it's in the arbitrary location of c:\windows\system32\drivers\etc\hosts. This kinda reminds me of a Unix/Linux path, with the \etc\hosts. But anyway. That's often too much to type in when just trying to go Start -> Run -> notepad++ hosts. So, use symbolic links :) Something else that is Unix/Linux like, that not many people know exist on Windows:

C:\>mklink hosts c:\windows\system32\drivers\etc\hosts
symbolic link created for hosts <<===>> c:\windows\system32\drivers\etc\hosts

Then you can just say, notepad++ \hosts.

Much easier.

Friday, December 28, 2012

Podcast Reunited

I used to struggle to get iTunes to download podcasts properly. Sometimes they wouldn't download fully, or couldn't be resumed and had to be re-started (IIRC, might have just been other downloads that did this). So I would download them as MP3's from the shows' archive websites, e.g. .NET Rocks!.

There is a problem with this though. When you add the files to iTunes, they are picked up as normal music, and not podcasts. This is sorted out easily by going into the file info and changing the Media Type to Podcast. Simple.

What is not so simple is why there are now two separate podcast entries - one for the subscription we used before, and one for the episodes that were downloaded manually. I used to ignore this, and just have them all on one playlist, but recently when I was re-importing everything into iTunes on a re-installed PC, I noticed this again and wanted to solve the issue.

MP3 files come tagged with ID3 tags. The standard ones such as artist, album, track number, etc. are easily editted in most audio programs, including iTunes. But for podcasts, there are some extended ones, namely PODCAST, PODCASTURL, PODCASTID, etc., which I found out using a program called Mp3tag.

You can update these tags using Mp3tag, and probably other software. For more info on this, see the question I asked (and answered) on Superuser.