This Gist goes over setting up a gulp workflow that will:
- watch for any sass changes, then compiles sass source into css
- watch for any changes in the public directory, and trigger live-reload
- serve static content in
public/
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp1.1</TargetFramework> | |
<RootNamespace>App</RootNamespace> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" /> |
// Router object | |
var Router = function () { | |
var self = this; | |
// Watch hashchange | |
window.onhashchange = function () { | |
self.process(); | |
}; | |
// Run on load |
public static void Utf8JsonReaderLoop(ReadOnlySpan<byte> dataUtf8) | |
{ | |
var json = new Utf8JsonReader(dataUtf8, isFinalBlock: true, state: default); | |
while (json.Read()) | |
{ | |
JsonTokenType tokenType = json.TokenType; | |
ReadOnlySpan<byte> valueSpan = json.ValueSpan; | |
switch (tokenType) | |
{ |
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<LangVersion>8</LangVersion> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="System.IO.Pipelines" Version="4.7.1" /> |
public void FormsAuthentication_OnAuthenticate(object sender, FormsAuthenticationEventArgs args) | |
{ | |
var machineKeySection = (MachineKeySection) WebConfigurationManager.GetWebApplicationSection("system.web/machineKey"); | |
var cookie = args.Context.Request.Cookies[".ASPXAUTH"]; | |
if (cookie == null || !Regex.IsMatch(cookie.Value, "^([a-fA-F0-9]{2})+$")) | |
return; | |
var cookieBytes = ByteUtility.ToBytes(cookie.Value); | |
int signatureLength; |
// Copyright (c) .NET Foundation. All rights reserved. | |
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |
using System; | |
using System.Buffers; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Threading; | |
using System.Threading.Tasks; |
Have a repository on GitHub? Planning on making a repository on GitHub? This checklist is intended to introduce you to various features that may help you make the most of your GitHub repository with specific recommendations for C# repositories.
These are only suggestions.
They may not be appropriate for all repositories.
They are in no particular order.
Click each item to expand for more information.
You can now read this on my (pretty) website! Check it out here.
Every reason to get more HackerPoints™ is a good one, so today we're going to
write a neat command line app in .NET Core! The Common library has a really cool
package Microsoft.Extensions.CommandlineUtils
to help us parse command line
arguments and structure our app, but sadly it's undocumented.
No more! In this guide, we'll explore the package and write a really neat