Skip to content

Instantly share code, notes, and snippets.

View mahizsas's full-sized avatar

MAHIZ mahizsas

View GitHub Profile
<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>
<?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$
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
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);
public class FeatureViewLocationRazorViewEngine : RazorViewEngine
{
public FeatureViewLocationRazorViewEngine()
{
ViewLocationFormats = new[]
{
"~/Features/{1}/{0}.cshtml",
"~/Features/{1}/{0}.vbhtml",
"~/Features/Shared/{0}.cshtml",
"~/Features/Shared/{0}.vbhtml",
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";
[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[]
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();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.WebPages;
namespace DynamicHtmlTemplates
{
public class Templates : System.Dynamic.DynamicObject
{
.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