Skip to content

Instantly share code, notes, and snippets.

View woloski's full-sized avatar

Matias Woloski woloski

View GitHub Profile
@woloski
woloski / WCfWebApiDynamicProgran.cs
Created January 27, 2012 18:01
WCF Web API dynamic JsonNet
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ApplicationServer.Http;
using System.ServiceModel;
using System.Net.Http;
using System.ServiceModel.Web;
using System.Net.Http.Headers;
using WebApiContrib.Formatters.JsonNet;
namespace YourWebApp.Controllers
{
using System;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using Microsoft.IdentityModel.Protocols.WSFederation;
using Microsoft.IdentityModel.Web;
using System.Net;
@woloski
woloski / gmail-backup.ps1
Created November 1, 2010 03:03
Powershell script that uses the gmail-backup.com cmd line tool to download emails from gmail in chunks of X days and store them in separate folders
## usage
## Download gmail-backup from www.gmail-backup.com and put it under "tools" folder relative to the script
## The idea is to download emails in small batches to avoid network issues and make a re-start easier. It also helps to avoid huge folders
## INPUT: the storage folder, amount of days to make the cut, start date, end date, credentials
## EXAMPLE:
## new-backup "d:\mail" 30 (get-date -year 2004 -month 01 -day 01) (get-date -y 2006 -month 01 -day 01) "youremail" "yourpwd"
function log($msg) {
$msg = (get-date).ToString("yyyyMMdd hh:mm:ss") + " $msg"
add-content log.txt $msg
@woloski
woloski / CloudQueueCacheDependency.cs
Created June 27, 2010 00:16
Invalidate ASP.NET Cache using a Windows Azure queue
namespace Southworks.WindowsAzure
{
using System;
using System.Web.Caching;
/// <summary>
/// Represents a cache dependency that uses Windows Azure queues to detect if an item in cache has changed
/// </summary>
/// <remarks>Sending a message a certain queue (specified using the <see cref="CloudQueueCacheDependencyMonitor" />) will invalidate the cache item </remarks>
/// <example>