Skip to content

Instantly share code, notes, and snippets.

@SangSuantak
SangSuantak / nginx.conf
Created May 3, 2024 12:01 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
public interface IAPIProvider
{
void SearchHotels();
void GetHotelDetails();
void GetRoomDetails();
void GetCancellationPolicies();
void GetExtraGuestChargeDetails();
void BlockRoom();
void BookRoom();
void GetBookingDetails();
@SangSuantak
SangSuantak / AsyncAwaitKeyPoints.md
Last active October 7, 2023 04:11
C# Async & Await Key Points
  1. Introduced in .Net 4.5
  2. The method signature includes an async modifier.
  3. The name of an async method, by convention, ends with an Async suffix.
  4. The return type is one of the following types:
    • Task<TResult> if your method has a return statement in which the operand has type TResult.
    • Task if your method has no return statement or has a return statement with no operand.
    • void if you're writing an async event handler. This return type is used primarily to define event handlers, where a void return type is required.
  5. The method usually includes at least one await expression, which marks a point where the method can't continue until the awaited asynchronous operation is complete. In the meantime, the method is suspended, and control returns to the method's caller.
  6. When the async method eventually completes its work, the task is marked as completed and the result, if any, is stored in the task.
  7. The async and await keywords don't cause additional threads to be
@SangSuantak
SangSuantak / CodingStandardsCSharp.cs
Last active April 27, 2017 07:12
C# Coding Standards/Conventions
// References
// 1. http://www.dofactory.com/reference/csharp-coding-standards
// 2. Modifications as per our usage
// 1. do use PascalCasing for class names and method names.
// --------------------------------------------------------
public class ClientActivity
{
public void ClearStatistics()
{