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
<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 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 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 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 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 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 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 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 MobileServiceRequestHelper<T> where T : class | |
{ | |
private string tableEndpoint; | |
private string applicationKey; | |
private HttpClient client; | |
public MobileServiceRequestHelper(string tableName) | |
{ | |
tableEndpoint = ConfigurationManager.AppSettings["TableEndpoint"] + tableName ; | |
applicationKey = ConfigurationManager.AppSettings["X-ZUMO-APPLICATION"]; | |
client = new HttpClient(); |
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.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.WebPages; | |
namespace DynamicHtmlTemplates | |
{ | |
public class Templates : System.Dynamic.DynamicObject | |
{ |
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
.filter('timeago', function () { | |
/* | |
* time: the time | |
* local: compared to what time? default: now | |
* raw: wheter you want in a format of "5 minutes ago", or "5 minutes" | |
*/ | |
// parse string date to milliseconds | |
// Note: months are 0-based |