Skip to content

Instantly share code, notes, and snippets.

View tawman's full-sized avatar

Todd A. Wood tawman

View GitHub Profile
@tawman
tawman / gist:4565494
Created January 18, 2013 15:48
Sliding and Absolute expiration in a dedicated Azure cache worker role question
public class AzureCacheFactory : IAzureCacheFactory
{
private readonly DataCache _cache;
private readonly DataCache _absoluteCache;
public AzureCacheFactory()
{
var factory = new DataCacheFactory();
_cache = factory.GetDefaultCache();
_absoluteCache = factory.GetCache("AbsoluteCache");
@tawman
tawman / commands.sh
Created November 14, 2013 21:36
Xamarin Studio and NuGet Package Restore
# /Users/todd/projects/SignalR/.nuget/nuget.targets: Error: Command 'mono --runtime=v4.0.30319 ../../.nuget/NuGet.exe install "packages.config" -source "https://nuget.org/api/v2/;http://www.myget.org/F/aspnetwebstacknightly/" -RequireConsent -solutionDir "../../" -nocache' exited with code: 1. (Microsoft.AspNet.SignalR.Client.Portable)
kvothe:Microsoft.AspNet.SignalR.Client.Portable todd$ mono --runtime=v4.0.30319 ../../.nuget/NuGet.exe install "packages.config" -source "https://nuget.org/api/v2/;http://www.myget.org/F/aspnetwebstacknightly/" -RequireConsent -solutionDir "../../" -nocache
Package restore is disabled by default. To give consent, open the Visual Studio Options dialog, click on Package Manager node and check 'Allow NuGet to download missing packages during build.' You can also give consent by setting the environment variable 'EnableNuGetPackageRestore' to 'true'.
kvothe:Microsoft.AspNet.SignalR.Client.Portable todd$ export EnableNuGetPackageRestore=true
kvothe:Microsoft.AspNet.SignalR.Cli
@tawman
tawman / MeanPractice.txt
Created January 13, 2014 01:02
6th Grade Math Mean Practice Homework Problem
Gina and Imani have an average of 41 stickers. Gina and Ella have an average of 48 stickers. If Ella has 3 times as many stickers as Gina, how many stickers does Ella have? How many more stickers does Imani have than Gina?
@tawman
tawman / git-unite-win10-x64-build.log
Created February 7, 2017 16:12
Git.Unite Build on Win10 x64
C:\git> git clone https://github.com/tawman/git-unite.git
Cloning into 'git-unite'...
remote: Counting objects: 140, done.
remote: Total 140 (delta 0), reused 0 (delta 0), pack-reused 140R
Receiving objects: 100% (140/140), 3.89 MiB | 938.00 KiB/s, done.
Resolving deltas: 100% (61/61), done.
C:\git> cd .\git-unite\
C:\git\git-unite [master =]> .\build.bat
C:\git\git-unite>C:\Windows\Microsoft.NET\Framework\V4.0.30319\msbuild /t:clean /v:n /p:Configuration=DEBUG src\Git.Unit
@tawman
tawman / Fetch.cs
Created January 16, 2018 03:56
PetaPoco Multi Fetch call
public List <TRet> Fetch<T1, T2, TRet>(Func <T1, T2, TRet> cb, string sql, params object [] args)
{
return Query<T1, T2, TRet>(cb, sql, args).ToList();
}
@tawman
tawman / UserPivot.sql
Created January 17, 2018 03:02
A Simple SQL PIVOT Query
SELECT *
FROM(SELECT * FROM UserRequirement) AS UserInfo
PIVOT (MIN(ExpirationDate)
FOR Requirement IN ([Alpha], [Bravo], [Charlie], [Delta], [Echo])
) AS UserPivot