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 .

May 8, 2012

Earthlings movie / Фильм Земляне







Certificate access permissions

In Windows Resource Kit there is a utility winhttpcertcfg.exe.

List certificate key permissions:
winhttpcertcfg.exe -l -c LOCAL_MACHINE\My -s "certificate.name"

 

Grant permissions to a certificate key:
winhttpcertcfg.exe -g -c LOCAL_MACHINE\My -s "certificate.name" -a WindowsAccount

 

Grant account permissions to run as a Windows service:
Logon as service policy

 

Grant account permissions to run as an ASP.NET application service:
aspnet_regiis -ga WindowsAccount

 

Give WindowsAccount write permissions to C:\Windows\Temp

If the certificate is not in this store and you want to move it there from another location, you must export the certificate and then import it. Do not drag and drop it in the Certificates MMC UI or it won't work.

Apr 13, 2012

PostSharp

http://www.sharpcrafters.com/

Aspect-oriented framework for .NET.

Name: OnExceptionAspect
Level: method
Note: exception handling in a marked method

Name: OnMethodBoundaryAspect
Level: method, class, assembly
Notes: intercepts certain points in a method’s execution: OnEntry, OnExit, OnSuccess, OnException

Name: MethodInterceptionAspect
Level: method
Notes: replaces method's contents that can be invoked
Example use: wait/retry, automatic thread delegation, lazy loading and validation

Name: LocationInterceptionAspect
Level: field, property
Notes: OnGetValue and OnSetValue
Example use: lazy loading, IoC Resolution

 

Subtle Patterns

http://subtlepatterns.com/

Cassette

http://getcassette.net

Bundle and minify scripts and stylesheets.

Reference files in javascript files to be automatically included (with intellisense in VS):
 /// <reference path="jquery.js"/>

Jan 30, 2012

Keeping it Simple, Template Routine


  1. Push Ups 3-4 sets of maximum repetitions (resting 1-2 minutes between sets) vary width between arms

  2. Pull Ups 3 sets of maximum repetitions (resting 2-3 minutes between sets) focusing on pulling as quickly as possible

  3. Forward Squats 4-5 sets of maximum repetitions (resting 1-2 minutes between sets) focus on moving both ends of the femur simultaneously

  4. Ankle Raises 3-4 sets of maximum repetitions (resting 2-3 minutes between sets) focus on constantly keeping your heels raised off the ground

  5. Twisting Crunches 3-4 sets of maximum repetitions (resting 2-3 minutes between sets) focus on using core muscles

  6. Plank 2 sets of holding for 1-2 minutes (resting 2-3 minutes between sets) if you have any back problems, avoid this exercise

  7. Leg Raises 3 sets of maximum repetitions (resting 2-3 minutes between sets) focus on using lower abdominals