This file contains hidden or 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
@functions | |
{ | |
public ConsoleApplication16.CoolModel Model { get; set; } | |
} | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> |
This file contains hidden or 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.Linq; | |
using NUnit.Framework; | |
using Raven.Client.Embedded; | |
namespace DocumentStoreTest | |
{ | |
[TestFixture] | |
public class DocumentStoreTests | |
{ | |
//This test attempts to lookup an existing item when none exist in the |
This file contains hidden or 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
(function ($) { | |
function getGravatarInfo(hash, callback) { | |
console.log(hash); | |
var url = "http://en.gravatar.com/" + hash + ".json?callback=?"; | |
$.getJSON(url, function (result) { | |
if (result.entry[0]) { | |
result = result.entry[0]; | |
callback(result); | |
} | |
}); |
This file contains hidden or 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.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using NUnit.Framework; | |
namespace MyProject | |
{ | |
[TestFixture] |
This file contains hidden or 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
public static class ControllerExtensions | |
{ | |
//should be safe for most controllers | |
private static MethodInfo _viewMethod; | |
private static readonly ConcurrentDictionary<Type, string> CachedPathNames = new ConcurrentDictionary<Type, string>(); | |
public static ActionResult TypedView(this Controller controller, Type type) | |
{ | |
return TypedView(controller, type, null, null); |
This file contains hidden or 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.Diagnostics; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains hidden or 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
public static class TypeBuilderFromJson | |
{ | |
public static Type CreateType(JObject jObject) | |
{ | |
var dict = new Dictionary<string, object>(); | |
foreach (var child in jObject) | |
{ | |
dict.Add(child.Key, child.Value); | |
} | |
return CompileResultType(dict); |
This file contains hidden or 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
public class ForeachRenderer : IRenderer | |
{ | |
public string Render(AbstractNode node, object model) | |
{ | |
object localModel = model; | |
if (node == null) | |
{ | |
throw new ArgumentNullException("node"); |
This file contains hidden or 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
private IEnumerable<string> GetIdentifierParts(string source) | |
{ | |
char[] splitBy = new[] { '.', '#' }; | |
int start = 0; | |
int index = 0; | |
string previousCharacter = ""; | |
while ((index = source.IndexOfAny(splitBy, start)) != -1) | |
{ |