This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Specialized; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using Moq; | |
/// <summary> | |
/// This helper class can be used to set up Moq mocks of MVC3 controllers. | |
/// Slightly modified from the original version from Scott Hanselman's blog: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ask the user for a gist name | |
param ( | |
[string]$gistname = "$(Read-Host 'Enter a name for the gist')" | |
) | |
# constant | |
$gistapi = "https://api.github.com/gists" | |
$filename = $gistname + '.diff' | |
$teststring = "`{`"description`": `"the description for this gist`",`"public`": true,`"files`": `{`"file1.txt`": `{`"content`": `"String file contents`"`}`}`}" | |
# get the diff from the current session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This returns a 404 not found - powershell; I expected a 401 if my creds were bad | |
$Url = "https://github.com/api/v2/xml/commits/list/fellowshiptech/portal/Portal_2011.6.23_15-26" | |
$webclient = new-object system.net.webclient | |
$webclient.credentials = new-object system.net.networkcredential("user", "password") | |
$result = $webclient.DownloadString($Url) | |
$result | |
//This returns the data I want via terminal | |
curl -u user:password https://github.com/api/v2/xml/commits/list/fellowshiptech/portal/Portal_2011.6.23_15-26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Example of a model that won't work with the current JsonValueProviderFactory but will work with JsonDotNetValueProviderFactory | |
public class CmsViewModel | |
{ | |
public bool IsVisible { get; set; } | |
public string Content { get; set; } | |
public DateTime Modified { get; set; } | |
public DateTime Created { get; set; } | |
//This property will not work with the current JsonValueProviderFactory | |
public dynamic UserDefined { get; set; } | |
} |