This file contains hidden or 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
using Microsoft.AspNetCore.Blazor; | |
public interface ITab | |
{ | |
RenderFragment ChildContent { get; } | |
} |
This file contains hidden or 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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.1</TargetFramework> | |
</PropertyGroup> | |
</Project> |
This file contains hidden or 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
// Copyright (c) Georgios Diamantopoulos. All rights reserved. | |
// Licensed under the MIT license. See LICENSE in this gist for full license information. | |
// The Throttle class is the RateGate class published here http://www.jackleitch.com/2010/10/better-rate-limiting-with-dot-net/, renamed and copied for convenience. | |
public static class BlockingCollectionExtensions | |
{ | |
// TODO: devise a way to avoid problems if collection gets too big (produced faster than consumed) | |
public static IObservable<T> AsRateLimitedObservable<T>(this BlockingCollection<T> sequence, int items, TimeSpan timePeriod, CancellationToken producerToken) | |
{ | |
Subject<T> subject = new Subject<T>(); |
This file contains hidden or 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
$regex = [regex] 'PackageReference Include="([^"]*)" Version="([^"]*)"' | |
ForEach ($file in get-childitem . -recurse | where {$_.extension -like "*proj"}) | |
{ | |
$proj = $file.fullname | |
$content = Get-Content $proj | |
$match = $regex.Match($content) | |
if ($match.Success) { | |
$name = $match.Groups[1].Value | |
$version = $match.Groups[2].Value | |
if ($version -notin "-") { |
This file contains hidden or 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
#Example moving the DPSG Global Library | |
# 1 Checkout the Beanstalk Repo | |
git clone --bare [email protected]:/dpsg-global-library.git | |
# 2 Push into your desired GitHub repo. (Please note that you must create the github repo prior to this step) | |
git push --mirror [email protected]:codeandtheory/dpsg-global-library.git |
This file contains hidden or 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
<html> | |
<body> | |
<!-- the following div is a sample representation of a 'car' domain object; it can be identified as | |
such by the presence of 'car' in its @class. In this case, the car has two attributes, a make | |
and a model, and both are included right here. This is what I call a deep/complete/concrete | |
representation. --> | |
<div id="car123" class="car"> | |
<span class="make">Ford</span> | |
<span class="model">Mustang</span> | |
</div> |
This file contains hidden or 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
/* | |
This overlay provides a 'liquid' mode to the excellent CodeMirror editor (http://codemirror.net/). | |
Add something like this to your CSS: | |
.cm-liquid-tag { | |
color: #32273f; | |
background: #ead9ff; | |
} | |
.cm-liquid-variable { |
This file contains hidden or 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
MKMapRect zoomRect = MKMapRectNull; | |
for (id <MKAnnotation> annotation in mapView.annotations) { | |
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); | |
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0); | |
if (MKMapRectIsNull(zoomRect)) { | |
zoomRect = pointRect; | |
} else { | |
zoomRect = MKMapRectUnion(zoomRect, pointRect); | |
} | |
} |