Skip to content

Instantly share code, notes, and snippets.

View alexdresko's full-sized avatar
💭
I'm not a player, I just code a lot.

Alex Dresko alexdresko

💭
I'm not a player, I just code a lot.
View GitHub Profile
// To use, just do something like :
// ViewBag.Stats = GetClicks(context);
private static List<Stats> GetClicks(AppContext context)
{
var result = new List<Stats>();
results.Add(GetStats(context, Period.Week))
results.Add(GetStats(context, Period.Month))
results.Add(GetStats(context, Period.Today))
@alexdresko
alexdresko / gist:7358904
Created November 7, 2013 17:54
Pair for Eric Lippert
void Main()
{
var result = GetStatusMessage(40);
}
struct Pair<T, V>
{
public T Key;
public V Value;
}
@alexdresko
alexdresko / T4TS.tt
Last active February 25, 2017 22:56
T4 template to generate TypeScript interface definitions with BreezeJS support.
<#@ template language="C#" debug="true" hostspecific="true" #>
<#@ output extension=".d.ts" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="Microsoft.VisualStudio.Shell.Interop.8.0" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="EnvDTE80" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="EnvDTE" #>
@alexdresko
alexdresko / GetSublimeTextKeyBindings.vb
Created March 5, 2012 21:36
GetSublimeTextKeyBindingsFromVisualStudioKeyboardShortcuts
Sub GetSublimeTextKeyBindings()
Dim cmd As Command
Dim ow As OutputWindow = DTE.Windows.Item(Constants.vsWindowKindOutput).Object
Dim owp As OutputWindowPane
Dim exists As Boolean
Dim i As Integer
Dim sArray() As String
Dim dict As New System.Collections.Generic.Dictionary(Of String, String)()
@alexdresko
alexdresko / Identity.cs
Created July 15, 2010 18:08
SharePointSiteAndWebHelper
namespace CSI.ESS.ServiceModel.Contracts
{
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Security.Principal;
/// <summary>
/// This class manages the creation of an impersonation to the Application
/// Pool's context for a defined scope.