Skip to content

Instantly share code, notes, and snippets.

View cyberzed's full-sized avatar

Stefan Daugaard Poulsen cyberzed

View GitHub Profile
@cyberzed
cyberzed / Controls.xaml
Created January 4, 2012 20:58
Could do but...
<ControlTemplate TargetType="TabItem">
<Grid x:Name="root"
Margin="0,0,15,0">
<ContentControl Content="{TemplateBinding Header}" FontSize="26.667">
<ContentControl.Foreground>
<SolidColorBrush Color="{DynamicResource Gray11}" />
</ContentControl.Foreground>
</ContentControl>
</Grid>
</ControlTemplate>
var observable = Enumerable.Range(0, 10).ToObservable();
observable.Subscribe(Console.WriteLine, () => Console.WriteLine("Complete"));
@cyberzed
cyberzed / BaseMessage.cs
Created January 9, 2012 22:30
Message abstraction
public abstract class BaseMessage
{
protected string Source;
protected string Destination;
protected string Content;
protected BaseMessage(string source, string destination, string content)
{
Source = source;
Destination = destination;
@cyberzed
cyberzed / ServiceClient.cs
Created February 15, 2012 19:59
Rx powered ServiceStack SL Client
public class ServiceClient<TRequest, TResponse>
where TRequest : class
where TResponse : class
{
private readonly string _baseUri;
private ISubject<TResponse> completionChannel;
public ServiceClient(string baseUri = "/api")
{
// make sure the base uri is set appropriately
public class MyClass : NotificationObject
{
private string myProperty = string.Empty;
public string MyProperty
{
get{ return myProperty; }
set{
myProperty = value;
RaisePropertyChanged( ()=> MyProperty );
public class ICC
{
public ICC(string number)
{
Number = number;
}
public string Number { get; private set; }
}
The term 'C:\tools\poshgit\dahlbyk-posh-git-60be436\profile.example.ps1' is not recognized as the name of a cmdlet, function, script file, or op
erable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\sdap\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:3 char:2
+ . <<<< 'C:\tools\poshgit\dahlbyk-posh-git-60be436\profile.example.ps1'
+ CategoryInfo : ObjectNotFound: (C:\tools\poshgi...ile.example.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
@cyberzed
cyberzed / SemanticVersionComparer.cs
Created August 10, 2012 22:10
Not sure this will be a sane solution...
public class SemanticVersionComparer : IComparer<SemanticVersion>
{
private IDictionary<VersionType, Func<SemanticVersion, SemanticVersion, int>> comparisons =
new Dictionary<VersionType, Func<SemanticVersion, SemanticVersion, int>>();
public int Compare(SemanticVersion x, SemanticVersion y)
{
if (x == y)
{
return 0;
@cyberzed
cyberzed / gist:3508873
Created August 29, 2012 09:07
What would you expect when converting a .NET Version to SemVer
Environment.Version.Major
//4
Environment.Version.Minor
//0
Environment.Version.Build
//30319
Environment.Version.Revision
//276
//SemVer ex1. 4.0.30319+276
@cyberzed
cyberzed / ServiceStackBookTitles.md
Last active December 14, 2015 07:29
Ideas for booktitles for my upcoming book on ServiceStack
  • The ServiceStack Book
  • Building With ServiceStack
  • ServiceStack 101
  • From databases to REST with ServiceStack
  • The Secret ServiceStack
  • Stacking the Web
  • Get Some Rest w/ServiceStack
  • ServiceStack: Got Your Back
  • REST easy with ServiceStack
  • REST in peace with ServiceStack