Skip to content

Instantly share code, notes, and snippets.

View dotMorten's full-sized avatar
:octocat:

Morten Nielsen dotMorten

:octocat:
View GitHub Profile
@dotMorten
dotMorten / XMLDocumentationStripper.cs
Last active September 14, 2016 17:54
Optimizes XML Doc for intellisense by stripping out internals and remarks from the XML doc
using Mono.Cecil;
using Mono.Cecil.Rocks;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
namespace ConsoleApplication1
{
class Program
{
@dotMorten
dotMorten / Program.cs
Last active December 8, 2016 20:08
Simple Iotivity Server and Light Resource created using .NET calling into the Iotivity C-API
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace SimpleServerNet
{
class Program
{
private static CancellationTokenSource ct;
@dotMorten
dotMorten / GpsCoordinateSimulator.cs
Created December 12, 2012 01:43
GeoPositionWatcher for more accurately simulating a GPS device, including change in accuracy, heading, and speed. This code is compatible with WPF, Windows Phone 7 and Windows Phone 8
// GpsCoordinateSimulator.cs:
// WPF: Requires reference to System.Device.dll
using System;
using System.Device.Location;
using System.Windows;
using System.Windows.Threading;
namespace GpsSimulator
{
/// <summary>
@dotMorten
dotMorten / Program.cs
Created August 25, 2017 21:47
Slow webserver response test
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace TimeoutTestApp
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.UI.Core;
using Windows.UI.Xaml.Data;
namespace UniversalTestApp
@dotMorten
dotMorten / ARApp.Android.cs
Last active March 16, 2018 16:58
Abstract UrhoSharp AR class
#if __ANDROID__
using Urho;
using System.Linq;
using Com.Google.AR.Core;
using Urho.Droid;
namespace UrhoAR
{
public abstract partial class ARApp : SimpleApplication
{
@dotMorten
dotMorten / HttpGZipClientHandler.cs
Last active May 8, 2018 19:38
GZip support for PCL HttpClient. Create HttpClient using: HttpClient client = new HttpClient(new HttpGZipClientHandler());
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
namespace SharpGIS.Http
{
public class HttpGZipClientHandler : HttpClientHandler
{
@dotMorten
dotMorten / RunUWPTests.cmd
Created September 29, 2018 03:44
Run UWP Unit Tests
REM Build project
msbuild /restore /t:Build /p:Platform=x64;Configuration=Debug MyUWPTestProject.csproj
REM Remove previous install
Powershell.exe -command "& {Remove-AppxPackage -Package 'd160b1a9-2c65-41ed-82af-4d4939e99742_1.0.0.0_x64__zy2ctb9gr90we'}"
REM Install cert. Note: Must be run with elevated (admin) access
certutil -addstore root "AppPackages\MyUWPTestProject_1.0.0.0_x64_Debug_Test\MyUWPTestProject_1.0.0.0_x64_Debug.cer"
REM Run Tests
@dotMorten
dotMorten / XF3.4-3.5.md
Last active February 9, 2019 00:43
What's new in Xamarin.Forms between 3.4.0.1008975 and 3.5.0.129452
namespace Xamarin.Forms
{
    public class Xamarin.Xamarin.Forms.BackButtonBehavior : BindableObject
    {
        public BackButtonBehavior();
        public ICommand Command { get; set;  }
        public object CommandParameter { get; set;  }
        public ImageSource IconOverride { get; set;  }
 public bool IsEnabled { get; set; }
@dotMorten
dotMorten / GraphicsTelemetry.cs
Created March 30, 2019 00:00
GraphicsTelemetry.cs
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
namespace TelemetryClientSample.Telemetry
{
class GraphicsTelemetry : ITelemetryInitializer
{