- Application
- Request Handling
- Authorization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var telemetryClient = new TelemetryClient(new TelemetryConfiguration("APP_INSIGHTS_KEY")); | |
var mongoConnectionString = "mongodb://localhost:27017/test"; | |
TrackMongoByEvents(mongoConnectionString, telemetryClient); | |
TrackMongoManually(mongoConnectionString, telemetryClient); |
It is simplest, thread-safe solution with lazy initialization, that everyone can understand.
Example pull from here https://rubikscode.net/2017/06/11/different-ways-to-implement-singleton-in-net-and-make-people-hate-you-along-the-way/ But also see this Jon Skeets http://csharpindepth.com/Articles/General/Singleton.aspx#lazy
- don't do if null check
- don't use locks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrapper { | |
.transition(@property: opacity, @duration: .2s, @timing: ease-in-out); | |
.opacity (@opacity: 1); | |
&.hide { | |
.opacity (@opacity: 0); | |
} | |
} | |
.wrapper { | |
& > * { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// base class | |
[BsonDiscriminator(RootClass = true)] | |
[BsonKnownTypes(typeof(Cat), typeof(Dog))] | |
public abstract class Animal | |
{ | |
public string id { get; set; } | |
public string name { get; set; } | |
public int age { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AllowAnonymous] | |
[HttpGet] | |
[Route("confirm-signup", Name = "ConfirmSignUpRoute")] | |
public async Task<IHttpActionResult> ConfirmSignUp(string userId = "", string code = "") | |
{ | |
IdentityResult confirmEmailResult = await this.AppUserManager.ConfirmEmailAsync(userId, code); | |
if (!confirmEmailResult.Succeeded) | |
{ | |
return GetErrorResult(confirmEmailResult); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Powershell | |
-- to remove gems | |
gem list | %{$_.split(' ')[0]} | %{gem uninstall -Iax $_ } | |
-- add back important ones | |
gem install bundler json minitest rake rdoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string path = args[0]; | |
Console.WriteLine("trying path: " + path); | |
if (Directory.Exists(path)) | |
Directory.GetFiles(path).ToList().ForEach(s => Console.WriteLine(s)); |
NewerOlder