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 ContentNegotiationPipelineItem : PipelineItem<Action<NancyContext>> | |
| { | |
| public ContentNegotiationPipelineItem() | |
| : base("Content Negotiation", action) | |
| { | |
| } | |
| static readonly Action<NancyContext> action = ctx => | |
| { |
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.Linq; | |
| using Nancy.ViewEngines; | |
| namespace Nancy | |
| { | |
| public static class CustomFormatterExtensions | |
| { | |
| public static Response AsNegotiated<TModel>(this IResponseFormatter formatter, TModel model, HttpStatusCode statusCode = HttpStatusCode.OK, Tuple<Func<Response>, string> defaultResponse = 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
| /* larger font size */ | |
| body.platform-mac.platform-mac-snowleopard .monospace, | |
| body.platform-mac.platform-mac-snowleopard .source-code, | |
| body.platform-windows .monospace, body.platform-windows .source-code , | |
| body.platform-linux .monospace, body.platform-linux .source-code { | |
| font-size: 20px !important; | |
| } |
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 Repository | |
| { | |
| private static readonly IList<Place> Places = new List<Place> | |
| { | |
| new Place(0, "Pastini Pastaria", "Lunch", "Dinner", "Pasta", "Beer", "Wine"), | |
| new Place(1, "Deschutes Brewery", "Lunch", "Dinner", "Pasta", "Beer", "Wine"), | |
| new Place(2, "Stumptown Coffee", "Breakfast", "Coffee"), | |
| new Place(3, "Voodoo Doughnuts", "Breakfast", "Coffee"), | |
| new Place(4, "J Cafe", "Breakfast", "Lunch", "Coffee"), | |
| }; |
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 OAuth2AuthenticationClient | |
| { | |
| public static void Enable(IPipelines pipelines, OAuth2AuthenticationClientConfiguration clientConfiguration) | |
| { | |
| if (!clientConfiguration.IsValid) | |
| throw new OAuth2AuthenticationClientConfiguration.InvalidConfigurationException(); | |
| pipelines.BeforeRequest.AddItemToStartOfPipeline(GetLoadAuthenticationHook(clientConfiguration)); | |
| pipelines.AfterRequest.AddItemToEndOfPipeline(GetRedirectToProviderHook(clientConfiguration)); | |
| } |
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 Auth | |
| { | |
| public static AuthenticationProviderConfiguration Configuration; | |
| public static void Enable(IPipelines pipelines, AuthenticationProviderConfiguration configuration) | |
| { | |
| pipelines.AfterRequest.AddItemToEndOfPipeline(ctx=> | |
| { | |
| if (ctx.Response.StatusCode==HttpStatusCode.Unauthorized) | |
| { |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="author" content="Martin Bean" /> | |
| <title>Twitter’s Bootstrap with Ryan Fait’s Sticky Footer</title> | |
| <link rel="stylesheet" href="css/bootstrap.min.css" /> | |
| <style> | |
| html, body { | |
| height: 100%; |
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
| # To delete all merged local branches (excluding non-origin remotes) | |
| git branch --merged master | grep -v 'master$' | xargs git branch -d | |
| # To delete all merged remote branches (excluding non-origin remotes) | |
| git branch -r --merged master | grep 'origin' | sed 's/ *origin\///' | grep -v 'master$' | xargs -i% git push origin :% | |
| # To remove orphaned remote branch references | |
| git remote | xargs -I% git remote prune % |
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
| define(['path/to/source', 'jasmine', 'jasmine-ajax'], function (source, jasmine) { | |
| describe('spec description', function(){ | |
| // Add specs here | |
| }; | |
| }); |
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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
| "http://www.w3.org/TR/html4/loose.dtd"> | |
| <html> | |
| <head> | |
| <title>Jasmine Spec Runner</title> | |
| <link rel="stylesheet" type="text/css" href="lib/jasmine.css"> | |
| <script type="text/javascript" src="../vendor/jquery.js" ></script> | |
| <script type="text/javascript" src="../vendor/require.js" ></script> | |
| <script type="text/javascript" src="lib/jasmine.js" ></script> |