Skip to content

Instantly share code, notes, and snippets.

Avatar
🛠️
Code.Build.Test.Deploy.Monitor.Repeat(); 🥇

dylanberry dylanberry

🛠️
Code.Build.Test.Deploy.Monitor.Repeat(); 🥇
View GitHub Profile
@dylanberry
dylanberry / 0_reuse_code.js
Created Feb 7, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View CheckBox.cs
/// <summary>
/// The check box.
/// </summary>
public class CheckBox : View
{
/// <summary>
/// The checked state property.
/// </summary>
public static readonly BindableProperty CheckedProperty =
BindableProperty.Create(nameof(Checked), typeof (bool), typeof (CheckBox), false, BindingMode.TwoWay,
View Startup.cs
using HttpTracer;
using System.Net.Http;
using Microsoft.AspNetCore.Components.Browser;
using Microsoft.AspNetCore.Components.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Components;
using System;
using Microsoft.AspNetCore.Blazor.Services;
using Microsoft.AspNetCore.Blazor.Http;
View Startup_HttpClient_DI.cs
using HttpTracer;
using System.Net.Http;
using Microsoft.AspNetCore.Components.Browser;
using Microsoft.AspNetCore.Components.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Components;
using System;
using Microsoft.AspNetCore.Blazor.Services;
using Microsoft.AspNetCore.Blazor.Http;
using System.Threading.Tasks;
View Linker.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Exclude EF.Core dependencies from Xamarin.iOS linking -->
<linker>
<assembly fullname="System">
<type fullname="System.ComponentModel.ReferenceConverter">
<method signature="System.Void .ctor(System.Type)" />
</type>
</assembly>
<assembly fullname="mscorlib">
<type fullname="System.String">
View VersionCheckHandler.Request.cs
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using VersionCheck.Common;
namespace VersionCheck
{
public class VersionCheckHandler : DelegatingHandler
View IVersionCheckService.cs
using Microsoft.AspNetCore.Http;
namespace VersionCheck.API.VersionCheck
{
public interface IVersionCheckService
{
void PerformVersionCheck(HttpRequest request);
string MinimumClientVersion { get; }
}
}
View MinimumClientVersionFilter.cs
using Microsoft.AspNetCore.Mvc.Filters;
namespace VersionCheck.API.VersionCheck
{
public class MinimumClientVersionFilter : IActionFilter
{
private readonly IVersionCheckService _versionCheckHelper;
public MinimumClientVersionFilter(IVersionCheckService versionCheckHelper)
{
View ClientVersionNotSupportedException.cs
using System;
using System.Runtime.Serialization;
namespace VersionCheck.Common
{
[Serializable]
public class ClientVersionNotSupportedException : Exception, ISerializable
{
public string MinimumSupportedClientVersionString { get; }
public string ApiVersionString { get; }
View VersionCheckHandler.cs
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using VersionCheck.Common;
namespace VersionCheck
{
public class VersionCheckHandler : DelegatingHandler