Skip to content

Instantly share code, notes, and snippets.

@codingoutloud
codingoutloud / RandomTokenGenerator.cs
Created Dec 4, 2012
Generate a random string that is URL safe.
View RandomTokenGenerator.cs
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 Dec 2, 2011
Newtonsoft Json Results for MVC
View BaseController.cs
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
{