- Clone the fork locally
- Add the original repo as a remote: https://help.github.com/articles/configuring-a-remote-for-a-fork/
git remote add upstream <url-from-remote-original>| // The type to be persisted | |
| using System; | |
| using Newtonsoft.Json; | |
| namespace Demo | |
| { | |
| public class SomeConfiguration | |
| { | |
| /// <summary> | |
| /// Gets or sets the identifier for this record. |
| /// <summary> | |
| /// Customize JSON serialization using Newtonsoft.Json | |
| /// </summary> | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Converters; | |
| using Newtonsoft.Json.Serialization; | |
| public static class JsonExtensions | |
| { | |
| public static string ToJson<T>(this T obj, bool includeNull = true) |
| # MyDirectory is a subdirectory of the current directory (i.e. the directory printed by pwd) | |
| Get-ChildItem -Path .\MyDirectory -Filter *.nuspec -Recurse -Name |
git remote add upstream <url-from-remote-original>let calculator = function(num1, num2) {| ConfigurationManager.RefreshSection("ConnectionStrings"); | |
| var connString = ConfigurationManager.ConnectionStrings["ReconciliationConnectionString"]; | |
| dynamic outObj; | |
| using (var connection = new SqlConnection(connString.ConnectionString)) | |
| { | |
| var result = connection.Query<dynamic>(GetCreateDealSproc(), | |
| new | |
| { | |
| UU_ID = 21096, | |
| NC_IDBuy = "GBP", |
| public static class UnhandledExceptionLogger | |
| { | |
| public static void Install() | |
| { | |
| var log = Log.ForContext(typeof(UnhandledExceptionLogger)); | |
| AppDomain.CurrentDomain.UnhandledException += (s, e) => | |
| { | |
| log.Fatal(e.ExceptionObject as Exception, "Unhandled exception caught at AppDomain boundary (terminating: {IsTerminating})", e.IsTerminating); | |
| }; |
SQL Joins explained briefly with examples. Applies to MS SQL. Assumes both tables contain unique records. Extracted from Jeff Attwood's blog post: https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
TABLE-A
| id | name |
|---|---|
| 1 | Pirate |
CORS or Cross Origin Resource Sharing is a way to allow cross domain requests to be serviced by the browser. It was implemented by browser vendors as a response to requests to let client side script make webservice calls across domains. Point to note is that it is the called webservice that has to allow CORS by adding appropriate headers to the response: Access-Control-Allow-Origin Access-Control-Allow-Headers Access-Control-Allow-Methods