Skip to content

Instantly share code, notes, and snippets.

<head runat="server">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="Content/public.css" type="text/css" media="all" />
<script src="<%: Url.Content("~/Scripts/jquery-1.4.1.min.js") %>" type="text/javascript"></script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Mvc;
namespace Web.Areas.Public
{
namespace Web.Areas.Public
{
public partial class Public : System.Web.Mvc.ViewMasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
@echo off
SET database.name="${database.name}"
SET sql.files.directory="%DIR%..\${folder.database}"
SET server.database="${server.database}"
SET repository.path="${repository.path}"
SET version.file="${file.version}"
SET version.xpath="//buildInfo/version"
SET environment="${environment}"
[Test]
public void UpdateAccountingYearTemplate()
{
using (var fixture = new FixtureInit(@"http://localhost"))
{
//INIT
var data = new PeriodsData(fixture.Context);
var setup = fixture.Setup;
//ACT
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Trackyourtasks.Core.DAL.DataModel;
namespace Trackyourtasks.Core.DAL.Repositories
{
/// <summary>
/// Repository of Blog posts
function api_test(url, type, data, callback) {
$.ajax(
{
url: url,
type: type,
processData: false,
contentType: 'application/json; charset=utf-8',
data: JSON.stringify(data),
dataType: 'json',
async: false,
namespace MyNamespace {
public static class MyHelper
{
public static MvcHtmlString MyHelper(this HtmlHelper helper)
{
return helper.AntiForgeryToken();
}
}
}
Watcher:
(wood) Watch at least one repository
(bronze) Watcher more than 10
(silver) Watcher more than 100
(gold) Watcher more than 500
Follower:
(wood) Follow at least one person
(bronze) Follow more than 10 people
(silver) Follow more than 100 people
public class HostedByCheckAttribute : ActionFilterAttribute {
public override void OnActionExecuting(ActionExecutingContext filterContext) {
var postId = filterContext.ActionParameters["id"] as int;
var postsRepo = new PostsRepository();
var post = postsRepo.Get(postId);
if (!post.IsHostedBy(/* ... */)) {
filterContext.Result = new ViewResult { ViewName = "InvalidOwner", ViewBag = filterContext.Controller.ViewBag, ViewData = filterContext.Controller.ViewData };
}