Nov 22, 2012

WebStorm, CoffeeScript, LESS

Setup External Tools to compile CoffeeScript (this helped):

  • Navigate to "External Tools" in the "IDE Settings".

  • Click the little ‘plus’ icon to ‘add’ a new tool.

  • Program: c:\Users\user.name\AppData\Roaming\npm\coffee.cmd

  • Parameters: -c $FileName$ (or whatever is needed)

  • Path: c:\Users\user.name\AppData\Roaming\npm (or whatever is needed)


Example setup to compile LESS (this helped):

  • c:\Users\user.name\AppData\Roaming\npm\lessc.cmd

  • $FileName$ > ..\lesscss\$FileNameWithoutExtension$.css

  • $FileDir$

Jul 12, 2012

MVC Html helper values and ModelState

Surprisingly, if you do a return View(model); in your postback action, the @Html.EditorFor helper does not use the values from the passed model, but the values from the ModelState are used instead. Supposedly for form input persistence reasons, but does not make sense to me since you explicitly pass on the model. To still use the html helpers and the model, you can clear the ModelState first in your action: ModelState.Clear();

 

May 15, 2012

Mercurial repository migration

Can be used to move a folder from one repository into its own repository. E.g.:
hg convert --filemap migrationMap "C:\Dev" "c:\src\MyProject"

 

migrationMap is a file with:
include MyProject
rename MyProject .