- Creating an element
- Add an id or class
- Add an attribute
- Adding children
- Adding siblings
- Adding a model parameter
- String literals
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
class WindowsAzureServiceBusQueueTest | |
{ | |
private static readonly string ClientId = Guid.NewGuid().ToString("N"); | |
private TokenProvider _credentials; | |
private NamespaceManager _namespaceClient; | |
private MessagingFactory _factory; | |
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
html { | |
head { | |
meta[charset="utf-8"] | |
meta[name="viewport" content="width=device-width"] | |
title > "RavenHQ - Home" | |
meta[http-equiv="Content-type" content="text/html; charset=utf-8"] | |
meta[name="google" content="notranslate"] | |
link[rel="shortcut icon" href="/Content/images/favicon0.ico"] | |
link[rel="stylesheet" href="/Content/css/style.css" type="text/css" media="all"] | |
script[src="/Scripts/modernizr-2.5.3.js" type="text/javascript"] |
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
#OS junk files | |
[Tt]humbs.db | |
*.DS_Store | |
#Visual Studio files | |
*.[Oo]bj | |
*.user | |
*.aps | |
*.pch | |
*.vspscc |
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 NancyDepdencyResolver : IDependencyResolver | |
{ | |
private TinyIoCContainer _container; | |
private DependencyResolver _resolver; | |
public NancyDepdencyResolver(TinyIoCContainer container) | |
{ | |
_container = container; | |
_resolver = new DependencyResolver(); | |
} |
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 Stream<T> | |
{ | |
private IEnumerable<T> _source; | |
private Queue<T> _storage; | |
private IEnumerator<T> _enumerator; | |
public Stream(IEnumerable<T> source) | |
{ | |
_storage = new Queue<T>(); | |
_source = source; |
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
@if (Request.IsAuthenticated) { | |
<text> | |
Hello, @Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })! | |
@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) { | |
@Html.AntiForgeryToken() | |
<a href="javascript:document.getElementById('logoutForm').submit()">Log off</a> | |
} | |
</text> | |
} else { | |
<ul> |
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
conditional(condition) { | |
true > lots of statements | |
false > lots of other statements | |
default > "will be called when condition doesn't match anything else" | |
} | |
conditional(condition) { | |
a > some value | |
b > something else | |
c > blah blah |
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
new { | |
Header = "Parrot", | |
Features = new [] { | |
"Familiar syntax", | |
"Extensible output", | |
"Simple model binding" | |
} | |
} |
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
[Test] | |
public void SimpleJsonTest() | |
{ | |
var model = new[] { new { Name = "Ben" } }; | |
string source = "Users(Users) > Name > @Name"; | |
Assert.AreEqual("{Users:[{Name:\"Ben\"}]}", Render(source, model)); | |
} |