Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am travisthetechie on github.
  • I am travisthetechie (https://keybase.io/travisthetechie) on keybase.
  • I have a public key whose fingerprint is D9E4 3DEE F609 F981 04DB 53DA BF08 B086 3903 C47C

To claim this, I am signing this object:

View New-path-with-data.cs
var pathBinding = new Binding()
{
Source = "M 12.5,3.5 a 22.5,22.5 0 0,1 0,43 a 22.5,22.5 0 1,0 0,-43 z"
};
var newPath = new Path
{
Height = height,
Width = width,
Stretch = Stretch.Uniform
};
@TravisTheTechie
TravisTheTechie / Program.cs
Created Jul 20, 2013
UseSubscriptionService() new usage
View Program.cs
class Program
{
static void Main(string[] args)
{
Bus.Initialize(sbc =>
{
sbc.ReceiveFrom("msmq://localhost/queue");
sbc.UseMsmq();
sbc.UseSubscriptionService("msmq://localhost/mt_subscriptions");
});
View gist:1906347
public interface ICommandPublisher
{
void Publish<T>(T command) where T : ICommand;
}
public class MassTransitCommandPublisher : ICommandPublisher, ILoggingSource
{
public void Publish<T>(T command) where T : ICommand
{
this.Debug("Publishing command {0}", command.GetType().Name);
View Main.cs
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoMobile.MVVM;
using System.Collections.ObjectModel;
namespace MVVMExample
{
View BalsamiqParser.cs
public class BalsamiqParser
{
public IEnumerable<PageObjectHierarchy> GenerateHierarchy(XDocument balsamiqXml)
{
// xml to objects
var items = balsamiqXml
.Descendants("control")
.Select(control => new PageObjectHierarchy
{
ControlTypeId = (string)control.Attribute("controlTypeID"),
@TravisTheTechie
TravisTheTechie / App.xaml.cs
Created May 24, 2011
WP7 App Using Cashbox for Mobile
View App.xaml.cs
public static DocumentSession Session { get; private set; }
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
Session = DocumentSessionFactory.Create(FileName);
}
// Code to execute when the application is activated (brought to foreground)
@TravisTheTechie
TravisTheTechie / cashboxexample.cs
Created Mar 18, 2011
An example using Cashbox
View cashboxexample.cs
using System;
using Cashbox;
public class Program
{
private static void Main(string[] args)
{
// only open one session for a given file at once
using (DocumentSession session = DocumentSessionFactory.Create("test.data"))
View clock.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="ShelfConfiguration" type="Topshelf.Shelving.ShelfConfiguration, TopShelf" />
</configSections>
<ShelfConfiguration Bootstrapper="StuffOnAShelf.AShelvedClock, StuffOnAShelf" />
<appSettings>
<add key="name" value="Coocoo" />
View TopshelfStuffExample.cs
namespace Stuff
{
using System;
using System.IO;
using System.Timers;
using log4net.Config;
using Topshelf;
using Topshelf.Configuration;
using Topshelf.Configuration.Dsl;