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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddHttpClient("myclient"); | |
// Global header propagation for any HttpClient that comes from HttpClientFactory | |
services.AddHeaderPropagation(options => | |
{ | |
options.HeaderNames.Add("Correlation-Id"); | |
}); | |
} |
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
// Use whatever namespacing works for your project. | |
namespace YourSite.Web.Controllers.Api | |
{ | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using System.Web; | |
using System.Web.Http; |
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
/** | |
List of radio buttons. Unlike checklist, value is stored internally as | |
scalar variable instead of array. Extends Checklist to reuse some code. | |
@class radiolist | |
@extends checklist | |
@final | |
@example | |
<a href="#" id="options" data-type="radiolist" data-pk="1" data-url="/post" data-title="Select options"></a> | |
<script> |
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 Umbraco.Core; | |
using Umbraco.Core.Events; | |
using Umbraco.Core.IO; | |
using Umbraco.Core.Services; | |
namespace Startup | |
{ | |
public class MediaEventHandler : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) |
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
function buffer(leafletGeometry, distance){ | |
var reader, input, buffer, bufferGeoJSON; | |
reader = new jsts.io.GeoJSONReader(); | |
input = reader.read(leafletGeometry.toGeoJSON()); | |
buffer = input.geometry.buffer(distance); | |
bufferGeoJSON = new jsts.io.GeoJSONWriter().write(buffer); | |
return L.geoJson(bufferGeoJSON); |