SQL Server diff two SQL Server tables From Stack Overflow SELECT t1.id FROM table1 t1 INNER JOIN table2 t2 ON t1.id = t2.id WHERE ISNULL(t1.field1,'') <> ISNULL(t2.field1,'') OR ISNULL(t1.field2,'') <> ISNULL(t2.field2,'') ...
git Git tips How do I modify a specific commit?I have the following commit history: HEAD HEAD~ HEAD~2 HEAD~3 git commit --amend modifies the current HEAD commit. But how do I modify HEAD~3?Stack OverflowSam Liao append ^ to the commit hash Store GitHub PAT in ~/.git-credentials, content: https://<
Integration API testing with Postman and Newman Add some test assertions to Postman requests used in development, and run them with Newman - voila automated integration tests. https://medium.com/@arthurgomesfaria/automating-apis-testing-with-postman-and-newman-a9a9ef0354d4
a11y Accessible input focus hiding Here is how to remove the input focus element for mouse users but have it remain for keyboard users.
dotnet CORS pre-flight OPTIONS request depends on Content-Type The spec shows that an XHR request only sends the OPTIONS pre-flight request with some content-types. It does not send an OPTIONS request with application/x-www-form-urlencoded but does with form-data or raw JSON. This knowledge can save a lot of pain when trying to call an MVC endpoint with an
dotnet Integration testing Web API endpoints with MSTest Using in-memory server [TestMethod] public void Get() { var client = new HttpClient(); var request = new HttpRequestMessage { RequestUri = new Uri("http://localhost/api/hello"), Method = HttpMethod.Get }; request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); using (var response = client.SendAsync(request).Result) {
JavaScript Angular Material, cli, karma From the error messages that give you the answer but it's still not clear department. Angular tests were throwing this error: Failed: Template parse errors: 'mat-card' is not a known element: 1. If 'mat-card' is an Angular component, then verify that it is part
dotnet Swagger and the IHttpActionResult return type Swagger is great for documenting APIs. Using an IHttpActionResult return type, however, means that Swagger does not know the data structure that will be returned: The fix Decorating the controller action method with the below ensures that Swagger is aware of the context. [System.Web.Http.Description.ResponseType(typeof(IEnumerable&
dotnet Swagger and https Swagger is great for documenting APIs, and installs easily via Nuget. However, it can be problematic over https, with an error "Can't read from server. It may not have the appropriate access-control-origin settings.". The solution The page is being loaded with the https:// protocol, however, Swagger
SQL Server SQL Server convert IDENTITY column to non-IDENTITY I made a fundamental mistake in the database architecture, and learnt that identity columns are great for programmatically generated database rows, however, for prescriptive data (such as a list of categories that does not change via the UI) then the id column is best managed manually to ensure consistency between
Azure LUIS, bot framework, and the 'None' intent So my bot was handling words like 'fsdfd' correctly, but any real words, for which I did not have an utterance defined in any intent, were being handled unexpectedly. For example, 'blue', 'student', and 'dog' were all being handled by the '
Azure Deploying Node.js to Azure with restify In following the generally-excellent Azure documentation, my NodeJS app would deploy from GitHub, build, and be available, however, it would not respond to hitting REST endpoints. Checking the Azure logs showed restify listening to http://undefined:undefined which to me meant it was listening to nothing. It should get the
dotnet Implementing IHttpActionResult in Web API 2 Default return type The default return type on Web API 2 controllers is a C# class or collection: // GET: api/Test public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } I love that abstraction: the framework builds the http response; headers, response code, and
Ghost Prism on Ghost with Casper theme There is a lot of inconsistent doco out there, so here are the latest settings to get C# syntax highlighting in a Ghost installation using the default Casper theme. Code Injection -> Blog Header <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/prism/1.
Featured Hello world The best time to create this blog was 15 years ago. Now is the current best time, so here it is.