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
[Fact] | |
public void First() | |
{ | |
var tokenHandler = new JWTSecurityTokenHandler(); | |
var symmetricKey = GetRandomBytes(256/8); | |
var now = DateTime.UtcNow; | |
var tokenDescriptor = new SecurityTokenDescriptor | |
{ | |
Subject = new ClaimsIdentity(new Claim[] |
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 CustomSiteRoutes : RouteBase | |
{ | |
public override RouteData GetRouteData(HttpContextBase httpContext) | |
{ | |
if (httpContext.Request.Url.Host.Contains("site2.com")) | |
{ | |
string url = httpContext.Request.AppRelativeCurrentExecutionFilePath; | |
string controllername = "Home"; |
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 FeatureViewLocationRazorViewEngine : RazorViewEngine | |
{ | |
public FeatureViewLocationRazorViewEngine() | |
{ | |
ViewLocationFormats = new[] | |
{ | |
"~/Features/{1}/{0}.cshtml", | |
"~/Features/{1}/{0}.vbhtml", | |
"~/Features/Shared/{0}.cshtml", | |
"~/Features/Shared/{0}.vbhtml", |
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
var baseService={ | |
$http: {}, | |
$q: {}, | |
rootUrl: 'http://localhost/api/', | |
urlSuffix:'', | |
get: function () { | |
var defer = this.$q.defer(); | |
this.$http.get(this.rootUrl + this.urlSuffix) | |
.success(function (response) { | |
defer.resolve(response.value); |
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.Linq; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace SampleApp.Controllers | |
{ | |
public class HomeController : Controller |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<?mso-application progid="Excel.Sheet" ?> | |
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" | |
xmlns:o="urn:schemas-microsoft-com:office:office" | |
xmlns:x="urn:schemas-microsoft-com:office:excel" | |
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" | |
xmlns:html="http://www.w3.org/TR/REC-html40"> | |
<Worksheet ss:Name="Sheet1"> | |
<Table> | |
$ROWSPLACEHOLDER$ |
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
<script type="text/ng-template" id="one.html"> | |
<div>This is first template</div> | |
</script> | |
<script type="text/ng-template" id="two.html"> | |
<div>This is second template</div> | |
</script> |
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
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) { | |
$httpProvider.responseInterceptors.push([ | |
'$q', '$templateCache', 'activeProfile', | |
function($q, $templateCache, activeProfile) { | |
// Keep track which HTML templates have already been modified. | |
var modifiedTemplates = {}; | |
// Tests if there are any keep/omit attributes. | |
var HAS_FLAGS_EXP = /data-(keep|omit)/; |
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
angular.module('app.core') | |
.factory('templateModifierInterceptor', [ | |
'$q', | |
'$templateCache', | |
function($q) { | |
var modifiedTemplates = {}; | |
var HAS_FLAGS_REGEX = /data-dom-(remove|keep)/; | |
var HTML_PAGE_REGEX = /\.html$|\.html\?/i; | |
return { |
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 (Model == null) { | |
<text>@ViewData.ModelMetadata.NullDisplayText</text> | |
} else if (ViewData.TemplateInfo.TemplateDepth > 1) { | |
<text>@ViewData.ModelMetadata.SimpleDisplayText</text> | |
} else { | |
foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForDisplay && !ViewData.TemplateInfo.Visited(pm))) { | |
if (prop.HideSurroundingHtml) { | |
<text>@Html.Editor(prop.PropertyName)</text> | |
} else { | |
<p> |