Skip to content

Instantly share code, notes, and snippets.

@JoeRobich
JoeRobich / ProcessRunner.cs
Created January 27, 2013 19:32
Quick stab at an architecture for running processes over data.
public interface IRunProcesses<T>
{
void RegisterProcess(IProcessItems<T> process);
}
public interface IProcessItems<T>
{
void Process(IEnumerable<T> items);
}
@JoeRobich
JoeRobich / KeyValueStore.cs
Created January 15, 2013 22:21
Simple KeyValueStore that I wrote and was unable to use.
public interface IKeyValueStore
{
object this[string key] { get; set; }
}
public static class KeyValueStoreExtensions
{
public static DateTime GetDateTime(this IKeyValueStore store, string key)
{
var val = store[key];
@JoeRobich
JoeRobich / JsFactory.ts
Created October 7, 2012 05:01
Port of AsFac ( https://github.com/thedevstop/asfac ) to TypeScript. Greatly simplified since there is no reflection in TypeScript. Passes no parameters when invoking a constructor and does not perform property injection.
interface ICallback {
(factory:JsFactory, scopeName:string):any;
}
interface ICallbackDictionary {
[name:string]:ICallback;
}
class JsFactory {
static DefaultScopeName = '';
@JoeRobich
JoeRobich / HashMap.as
Created September 14, 2012 04:26
ActionScript IoC
package com.thedevstop.utilities
{
import flash.utils.Dictionary;
public class HashMap extends Dictionary
{
public function get(key:*):*
{
return this[key];
}
@JoeRobich
JoeRobich / GeometryConverter.cs
Created April 7, 2012 18:43
Abstraction to allow System.Web.Extension JavaScriptConveters to run as JSON.Net JsonConverters.
using System;
using System.Collections.Generic;
using Serialization.Text
namespace Drawing.Geometry
{
public class GeometryConverter : IJsonConverter
{
public object Deserialize(IDictionary<string, object> dictionary, Type type, IJsonSerializer serializer)
{
@JoeRobich
JoeRobich / Settings.vb
Created August 11, 2011 20:38
The Visual Studio macros for creating a Settings menu/toolbar.
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Public Module Settings
Private Const FONT_SIZE_CATEGORY As String = "FontsAndColors"