Send mail to the author(s) E-mail

# Wednesday, 27 April 2016

Inspired by:

which was itself inspired by a Jimmy Bogard article

If you get the MSDTC error

Here is the start of an example just using rollback transactions

[TestClass] public class TransactionTests { [TestMethod] public void Insert_User_and_test_transaction_rolls_back() { var user = new User { CreatedDate = DateTime.Now, DisplayName = "Todd Smith4", Email = "", Active = true }; var sql = "INSERT INTO dbo.Users (CreatedDate, DisplayName, Email, Active) VALUES (@CreatedDate, @DisplayName, @Email, @Active)"; db.Execute(sql, user); var retrievedUser = db.Query<User>("select * from users where Email = @email", new { email = user.Email }).FirstOrDefault(); Assert.AreEqual(user.DisplayName, retrievedUser.DisplayName); Assert.AreEqual(user.Active, retrievedUser.Active); Assert.AreEqual(user.CreatedDate.ToString(), retrievedUser.CreatedDate.ToString()); }


private TransactionScope scope; private DbConnection db; private DapperUserRepositoryTestContext c; private bool rollBackTransaction = true; // before each test [TestInitialize] public void SetUp() { // direct access to the db db = new SqlConnection( ConfigurationManager.ConnectionStrings["DapperMangoTestingConnectionString"].ConnectionString); if (rollBackTransaction) scope = new TransactionScope(); // going through the repo c = new DapperUserRepositoryTestContext(); } // after each test [TestCleanup] public void TearDown() { if (rollBackTransaction) scope.Dispose(); db.Dispose(); }
| | # 
# Wednesday, 06 April 2016
( Git )

I’ve come across a situation where the only way to have git is to install it locally, then push to a safe backed up fileshare.

Setup a bare repo on the fileshare

git init –bare

Add a remote

git init
git add .
git commit –m “initial commit”
git remote add origin file://j:\git\test  -- add a remote called origin…  note file://h:\\git\\booktech notice escapes in gitbash
git push --set-upstream origin master

Clone test

git clone j:\git\test .

| | # 
# Tuesday, 29 March 2016

“Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.”

  • Open Cmd prompt as admin
  • Paste in code
  • choco


choco install ccleaner

Very useful for new build!

| | # 
# Thursday, 24 March 2016

for %%a in ("*.mp4") do ffmpeg -i "%%a" "newfiles\%%~na.mp3"


Converts all mp4's in directory to newfiles\

Open ffmpeg in its own cmd shell

| | #