Skip to content

Instantly share code, notes, and snippets.

View circleupx's full-sized avatar

Yunier circleupx

  • South Florida
  • 22:35 (UTC -04:00)
View GitHub Profile
using System.Collections.Generic;
namespace Sitecore.StaticAssets.Infrastructure
{
public class AssetCollection : Dictionary<string, string>
{
}
}
using System.Diagnostics;
using System.IO;
using System.Web.Caching;
using Newtonsoft.Json;;
namespace Sitecore.StaticAssets.Infrastructure
{
public class StaticAssetResolver
{
private readonly string _assetsJsonPath;
using System.Web;
using Sitecore.StaticAssets.Infrastructure;
namespace Sitecore.StaticAssets.Html.Helpers
{
public static class StaticAssets
{
private static StaticAssetResolver _assetResolver;
public static void Initialize(StaticAssetResolver staticAssetResolver)
using Sitecore.Pipelines;
using Sitecore.StaticAssets.Infrastructure;
namespace Sitecore.StaticAssets.Pipelines
{
public class InitializeStaticAssetsResolver
{
private readonly string _assetPath;
public InitializeStaticAssetsResolver(string assetPath)
@heytherewill
heytherewill / RxMappings.csv
Created March 3, 2019 20:03
Rx.NET mappings
Rx.NET name Reactive Extensions name
Observable.Return Observable.just
Select map
SelectMany flatMap
Where filter
Aggregate reduce
Debounce throttle
Synchronize serialize
@mikebridge
mikebridge / EventAggregator.cs
Last active March 10, 2021 02:28
A simple Event Aggregator that allows multiple subscribers per message type.
using System;
using System.Reactive.Linq;
using System.Reactive.Subjects;
// inspired by https://github.com/shiftkey/Reactive.EventAggregator/blob/master/src/Reactive.EventAggregator/EventAggregator.cs
namespace Messaging
{
public interface IEventAggregator : IDisposable
{
@janv8000
janv8000 / AsyncRunner.cs
Created January 12, 2015 13:32
Start background tasks from MVC actions using Autofac
public interface IAsyncRunner
{
void Run<T>(Action<T> action);
}
public class AsyncRunner : IAsyncRunner
{
public ILifetimeScope LifetimeScope { get; set; }
public AsyncRunner(ILifetimeScope lifetimeScope)
@tugberkugurlu
tugberkugurlu / WebApiSimplePatchSample.cs
Last active January 20, 2022 13:08
ASP.NET Web API Patch Sample.
public class Car {
public int Id { get; set; }
[Required]
[StringLength(20)]
public string Make { get; set; }
[Required]
[StringLength(20)]
@Gutek
Gutek / C# Version Cheat Sheet.md
Last active February 8, 2022 09:33
Short cheat sheet of changes in C# language from version 6 to 9

CS 6

read-only auto properties

Small help with immutable types...

// private readonly int _age;
// public int Age { get { return _age; } }
public int Age { get; }
@chaoaretasty
chaoaretasty / WebAPI HttpContext for Autofac
Created October 14, 2013 16:53
Hackily enable HttpContext in WebAPI and Autofac
/*
While generally using HttpContext, and all of the related properties such as
Cookies and Session, in WebAPI is not the right way sometimes it needs to be
done, especially when migrating existing code before doing a full rewrite but
could happen in any legacy MVC project you want to bring WebAPI into.
When using Autofac there is the AutofacWebTypesModule which allows you to resolve
these dependencies, all of which come from resolving HttpContextBase.
WebAPI doesn't provide HttpContext directly but if hosted in IIS rather than