Skip to content

Instantly share code, notes, and snippets.

View xavierdecoster's full-sized avatar

Xavier Decoster xavierdecoster

View GitHub Profile
@maartenba
maartenba / CachedQueryable.cs
Created March 30, 2012 17:22
A fresh draft of CachedQueryable<T>
class Program
{
static void Main(string[] args)
{
List<Person> source = new List<Person>();
source.Add(new Person { Id = 1, Name = "Maarten" });
source.Add(new Person { Id = 2, Name = "Xavier" });
var cache = new List<Person>();
public class SomeClass {
public void SomeMethod() {
this.Log().Info(() => "Here is a log message with params which can be in Razor Views as well: '{0}'".FormatWith(typeof(SomeClass).Name));
}
}
@timiles
timiles / InMemoryTableStorage.cs
Last active December 9, 2015 12:37
use Microsoft.Experience.CloudFx.Framework.Storage.InMemoryCloudTableStorage
// use Microsoft.Experience.CloudFx.Framework.Storage.InMemoryCloudTableStorage
@shiftkey
shiftkey / duchess.md
Last active December 14, 2015 01:38
Some words about a project idea codenamed Duchess - the goal is to make a replacement for Sandcastle and make creating documentation for open source project cool again

Burn Sandcastle to the Ground

Addressing The Documentation Problem

I've had lots of discussions with people over the past few days around how open source projects in the .NET space have poor documentation (if it exists). So how do we fix this?

At a high-level, I've got these goals in mind:

  • make it easy
  • make it cool
public class OctopusRestApi : ApiDefinition
{
public OctopusRestApi()
{
#region Projects
Get["/api/projects/all"] = ListAll<ProjectSummaryIndex, Project, ProjectResource>()
.WithDescription("Lists the name and ID of all of the projects in the current Octopus installation. The results will be sorted alphabetically by name.")
.WithCustomQuery(projects => projects.OrderBy(m => m.Name));
Get["/api/projects/{id}"] = Load<Project, ProjectResource>()
#this automates the steps found here: http://docs.nuget.org/docs/workflows/migrating-to-automatic-package-restore
#yes, you could code golf this to about 6 characters if you wanted to
$find= @'
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
'@
foreach ($f in Get-ChildItem -Recurse -Path ".\" -Filter *.csproj | sort-object)
{
$text = Get-Content $f.FullName -Raw
@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)