Saturday, April 15, 2017

Git tips


Set up Git

Removing non-repository files with git?

--------------------------------------------------------------------------------------------------------------

How do I discard unstaged changes in Git?

Ans: 
a)For a specific file use:
git checkout path/to/file/to/revert
b)For all unstaged files use:
git checkout -- .
Make sure to include the period at the end.
c)To check out specific files
git checkout -- cats.html index.html
---------------------------------------------------------------------------------------------------------------------
git branch -a                                     -- lists all branches
git push origin :branchnamehere     -- to delete the remote branch(note semicolin before                                                                                    branchname)

git remote show origin                     -- checks for stale branches tracking origin
git remote prune origin                     -- to clean up deleted remote branches

git tag                                                           -- list all tags
git tag -a v0.1.2.3 -m "versioncomments"   -- add a new tag
git push --tags                                              -- to push new tags


---------------------------------------------------------------------------------------------------------------------
git fetch      -- pulls down the history but does not merge

rebase vs Merge
Rule of thumb:
1. When pulling changes from origin/develop onto your local develop use rebase.
          git pull --rebase

2. When finishing a feature branch merge the changes back to develop.

---------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------------------------------------------------------



Getting up to speed with StructureMap

Developer Basics




https://jeremydmiller.com/2014/11/07/strong_typed_configuration/



--------------------------------------------------------------------------------------

TDD rules : - 
  1. Isolate the Ugly Stuff
  2. Push, Don’t Pull (this post)
  3. Test small before testing big
  4. Avoid a long tail
  5. Favor composition over inheritance
  6. Go declarative whenever possible
  7. Don’t treat testing code like a second class citizen
  8. Isolate your unit tests, or suffer the consequences!
  9. The unit tests will break someday
  10. Unit tests shall be easy to setup
And the overriding “Zeroeth Law” is “If code is hard to test, change it.”
ref:  http://codebetter.com/jeremymiller/2006/03/09/jeremys-second-law-of-tdd-push-dont-pull/ 

--------------------------------------------------------------------------------------

Wednesday, April 12, 2017

WebApi Notes



In ASP.NET Web API 2 

To return a custom response you can use new helper methods exposed through ApiController such as:
  • Ok
  • NotFound
  • Exception
  • Unauthorized
  • BadRequest
  • Conflict
  • Redirect
  • InvalidModelState

---------------------
13/11/2020  SignalR 2 (.net framework) Tip
You would be unable to connect to signalr 2 (.net version) running on your visual studio/localhost if the visual studio is not running as Admin.


Monday, April 3, 2017

Angular 2 on Azure



A Good post to publish on to a Azure 
http://abusanad.net/2016/07/24/publish-angular-2-app-from-visual-studio-to-azure/#comment-8701

An important change to note is
Node is present on webapp server but it would not return version number with the command.
but the good news is npm install command works well.

Ref: https://blogs.msdn.microsoft.com/azureossds/2016/04/20/nodejs-and-npm-versions-on-azure-app-services/



Issue 1:  404 errors in the site
Situation: providing access to api data folders on azure.
Solution : Ref: https://blogs.msdn.microsoft.com/benjaminperkins/2014/09/01/the-webpage-cannot-be-found-404-when-accessing-a-file-on-azure-websites/


Devops links

  Build Versioning in Azure DevOps Pipelines