Skip to content

Instantly share code, notes, and snippets.

@jdaigle
jdaigle / example.csproj.xml
Last active September 29, 2019 17:11
Web App csproj for .NET Core
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<RazorCompileOnBuild>true</RazorCompileOnBuild>
<RazorTargetName>$(MvcRazorOuputPath)$(MSBuildProjectName).PrecompiledViews</RazorTargetName>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
public class DateComparisonBenchmarks
{
private DateTime _dateTimeA;
private DateTime _dateTimeB;
private LocalDate _localDateA;
private LocalDate _localDateB;
[GlobalSetup]
public void GlobalSetup()
{
@jdaigle
jdaigle / AspNetMvcCore.md
Last active March 13, 2017 15:40
Async Action Filters in MVC

API:

interface IFilterMetadata

interface IOrderedFilter : IFilterMetadata {
    int Order { get; }
}

interface IExceptionFilter : IFilterMetadata {

void OnException(ExceptionContext context);

@jdaigle
jdaigle / hgrc
Created June 3, 2016 00:45
by default, merge csproj files as a union
[merge-patterns]
**.csproj = internal:union
public static class CommandHandlerRegistration
{
public static void Init()
{
// manual registration
Register<AddProductModel, int>((c, r) => ProductsCommandHandlers.AddProductModel(c, r.Resolve<DbContext>()));
Register<AddProductReview>((c, r) => ProductsCommandHandlers.AddProductReview(c, r.Resolve<CommandContext>()));
Register<SetProductModelName>((c, r) => ProductsCommandHandlers.SetProductModelName(c, r.Resolve<CommandContext>()));
}
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0

Lunch-and-Learn Topics and Ideas

  1. Git with Visual Studio and TFS (with some GitHub and CLI mixed in).
  2. C# Async Myths. Learn about IOCP, Tasks, and async/await keywords. Best practices, and common mistakes.
  3. NancyFX, and other non-MVC server-side web app frameworks.
  4. ASP.NET and .NET Core. Starting with OWIN/Katana and demo the latest bits. May be worth waiting until it's actually released?
  5. Intro to TeamCity. Into to Jira.
  6. SQL Schema Version Control Showdown: SSDT versus Migrations.

Joseph Daigle is a Principal Consultant with Intellinet and a software craftsman with over a decade's experience developing highly scalable software systems and applications for clients big and small. Joseph has worked on systems ranging from healthcare to GIS, on small teams and traditional big-enterprise IT. Specialties include data access strategies, SQL, web technologies, messaging patterns, and system and data integration patterns.

/*
* Written by Doug Lea and Martin Buchholz with assistance from members of
* JCP JSR-166 Expert Group and released to the public domain, as explained
* at http://creativecommons.org/publicdomain/zero/1.0/
*/
package java.util.concurrent;
import java.util.AbstractQueue;
import java.util.Arrays;
@jdaigle
jdaigle / enqueue.cs
Last active February 19, 2021 08:35
public QueueEntry Enqueue(object item)
{
var entry = new QueueEntry(item);
while (true)
{
var prevTail = this.tail;
var prevTailNext = prevTail.Next;
if (prevTail == this.tail)
{
if (prevTailNext == null)