propv.snippet for creating Automatic virtual properties in C# Sep 23, 2011 I’m all about saving time. I have a huge collection of helpful snippets. Here’s one that automatically creates a virtual property, which is really helpful if you use Castle’s DynamicProxy (NHibernate uses this). ...
Editing JavaScript in vim Sep 5, 2011 I primarily use vim as my editor of choice for JavaScript. I have a fairly simple .vimrc: syntax on " enabled syntax highlighting :set number " line numbers :set ai " autoindent :set tabstop=4 " sets tabs to 4 characters :set shiftwidth=4 :set expandtab :set softtabstop=4 " makes the spaces feel like real tabs " CSS (tabs = 2, lines = 79) autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType css set sw=2 autocmd FileType css set ts=2 autocmd FileType css set sts=2 " JavaScript (tabs = 4, lines = 79) autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType javascript set sw=4 autocmd FileType javascript set ts=4 autocmd FileType javascript set sts=4 " autocmd FileType javascript set tw=79 autocmd FileType jade set omnifunc=jadecomplete#CompleteJade autocmd FileType jade set sw=2 autocmd FileType jade set ts=2 autocmd FileType jade set sts=2 " Highlight current line only in insert mode autocmd InsertLeave * set nocursorline autocmd InsertEnter * set cursorline " Makefiles require TAB instead of whitespace autocmd FileType make setlocal noexpandtab " Highlight cursor highlight CursorLine ctermbg=8 cterm=NONE I also use the JavaScript syntax/indents found here: ...
testy C# Test Method Snippet Aug 30, 2011 This is a pretty trivial snippet, but I use it quite a lot. Save this file as testy.snippet in your [Visual Studio]\VC#\Snippets\1033\Test directory. ...
Origin of the term “bug” Aug 27, 2011 Grace Murray Hopper was a Navy officer who was instrumental in the development of COBOL, one of the first programming languages to use the English language to write code instead of assembly or machine language. ...
[c#] Instantiating an object with a private constructor Aug 27, 2011 Not too long ago, I needed to modify a type available in the the BCL which didn’t have a public constructor or any method for creating an instance of the object. ...
[js] Closures versus Functional Scoping Aug 27, 2011 I was recently asked a very simple JavaScript question: what is a closure? Of course, I answered it (correctly, might I add) as “it means capturing a variable inside a function”. ...
[node.js] Getting started with nodeunit Aug 17, 2011 The following code is part of the testing chapter I previously worked on in my fork of Mastering Node. Throughout this post, you’ll see references to files from a relative directory. ...
Posting complex models to ASP.NET MVC Aug 16, 2011 Nick Riggs wrote a nice little jQuery plugin called postify that I have found extremely handy on many occasions. The code builds posted data into a format which is more understandable to the default ModelBinder in ASP. ...
DataAnnotations, MVC 3, and Unobtrusive Validations Aug 15, 2011

DataAnnotations are a pretty cool introduction to .NET 3.5+. It is very useful in ASP.NET MVC 3, and I’ve written a somewhat naive attempt to use this functionality in ASP.NET Web Forms which some people have found very useful.

I’d like to dig a little more in depth…

...
Running additional Google Chrome profiles in Linux Aug 14, 2011 Google Chrome supports running multiple profiles. In newer versions of Google Chrome, you’ll be able to enable profiles by navigating to chrome://flags and enabling Multiple Profiles. ...