Skip to content

Instantly share code, notes, and snippets.

@codingoutloud
codingoutloud / RandomTokenGenerator.cs
Created December 4, 2012 04:14
Generate a random string that is URL safe.
using System;
using System.Security.Cryptography;
using System.Web;
namespace DevPartners
{
// author: Bill Wilder, @codingoutloud
// original: https://gist.github.com/4200537
public static class RandomTokenGenerator
{
@jpoehls
jpoehls / BaseController.cs
Created December 2, 2011 19:38
Newtonsoft Json Results for MVC
using System;
using System.Linq;
using System.Web.Mvc;
public abstract class BaseController : Controller
{
protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding)
{
return new JsonNetResult
{