Log4Net

Remember this at start: log4net.Config.XmlConfigurator.Configure();

Posted in Uncategorized | Leave a comment

GIT merge branch into master

git checkout master
git pull origin master
git merge test
git push origin master

[where test is the branch]

http://stackoverflow.com/questions/5601931/best-and-safest-way-to-merge-a-git-branch-into-master

Posted in Uncategorized | Leave a comment

TeamCity/GitLab

http://laurentkempe.com/2012/08/24/TeamCity-and-Gitlab-working-together-with-SSH-Keys/

Basically, use PuTTy to create a public key, export it to an open format, then save it in both GitLab and TeamCity

Posted in Uncategorized | Leave a comment

Installing a Windows Service without installutil

SC Create

sc create binPath= "\"<executablepath>\" --Service" DisplayName= <displayname> depend= tcpip start= auto obj= <identity> password= <password>

The biggest trick is remembering the “=” sign is part of parameter name. It’s “start=_auto” not “start_=_auto”.

http://stackoverflow.com/questions/3663331/creating-a-service-with-sc-exe-how-to-pass-in-context-parameters

Posted in Uncategorized | Leave a comment

Handy GIT diagram and Commands

 

https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html (diagram not from here)

 

Posted in Uncategorized | Leave a comment

Noda

http://nodatime.org/ (and the related http://www.joda.org/joda-time/quickstart.html)

Much faster than .NET’s DateTime for timezone conversions.

 

Converting from a UTC DateTime to “zoned time”

var nodaTz = DateTimeZoneProviders.Bcl[windowsId];
var inst = Instant.FromDateTimeUtc(utcDtInput);
var result = inst.InZone(nodaTz).ToDateTimeUnspecified();

Converting “zone time” to UTC DateTime

var nodaTz = DateTimeZoneProviders.Bcl[windowsId];
var nodaLocalDt = LocalDateTime.FromDateTime(zoneDtInput);
var result = nodaTz.AtLeniently(nodaLocalDt).ToDateTimeUtc();
Posted in Uncategorized | Leave a comment

EF6 hint to success

In Visual Studio

Use “ADO.NET Entity Data Model” wizard

use “code first from database”

get rid of any OnModelCreate

Too take a standard connection string and make it DBContextSuitable, use SqlConnectionStringBuilder

Posted in Uncategorized | Leave a comment