Skip to content

Instantly share code, notes, and snippets.

View CasperTDK's full-sized avatar

Casper Thygesen CasperTDK

View GitHub Profile
@CasperTDK
CasperTDK / Azure.auth.cs
Created November 19, 2018 08:16
Azure.auth.cs
private void ConfigureBackOfficeAzureActiveDirectoryAuth(IAppBuilder app)
{
string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
string tenantId = ConfigurationManager.AppSettings["ida:TenantId"];
string caption = ConfigurationManager.AppSettings["ida:Caption"];
var uri = GeneralConfiguration.AppSettingValueOrDefault("customDomainName", ConfigurationManager.AppSettings["bindingurl"]);
var loginRedirectUri = new UriBuilder(uri)
{
Port = -1,
public class MessageInfoAggregatorSaga : Saga<MessageAggregaterSagaData>,
IAmInitiatedBy<SendMessageInfo>,
IHandleMessages<DispatchMessageInfo>
{
private readonly IBus _bus;
private readonly IMessageService _messageService;
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly MessageAggregator _messageAggregator = new MessageAggregator();
Bad:
<TextBlock Text=" (" FontWeight="Bold"></TextBlock>
<TextBlock Text="{Binding Path=ShortName}" FontWeight="Bold"></TextBlock>
<TextBlock Text=")" FontWeight="Bold"></TextBlock>
Good:
<TextBlock Text="{Binding Path=ShortName, StringFormat={} ({0})}" FontWeight="Bold" />
Multibinding:
@CasperTDK
CasperTDK / TestSerialization.cs
Created August 21, 2013 08:38
Test datacontract on message dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using NUnit.Framework;
namespace PBAServer.Test
{
[TestFixture]
#!/usr/bin/ruby
# Dropzone Destination Info
# Name: Pastebin
# Description: Copies text from clipboard to pastebin.com. Replaces clipboard with pastebin url. Dragging text is possible as well.
# Handles: NSStringPboardType
# Events: Clicked, Dragged
# Creator: CasperT
# URL: portableinfo.com
# IconURL: http://portableinfo.com/pastebin.png