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
void BeginNamespace(string namespaceName, CodeGenerationTools code) | |
{ | |
CodeRegion region = new CodeRegion(this); | |
if (!String.IsNullOrEmpty(namespaceName)) | |
{ | |
#> | |
#region EF Generated Code //<- right here | |
namespace <#=code.EscapeNamespace(namespaceName)#> | |
{ | |
<#+ |
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 (Html.BeginForm("Create", "MyModel", FormMethod.Post, new { id = "CreateForm" })) | |
{ | |
@Html.ValidationSummary(true) | |
<fieldset> | |
<legend>MyModel</legend> | |
<div class="editor-label"> | |
@Html.LabelFor(model => model.Property) | |
</div> | |
<div class="editor-field"> |
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
@Html.ActionLink("Click me!", "AjaxStuff", null, | |
new { id = "ajaxstuff" }) |
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.Data.Entity; | |
using Hurf.Durf.Model; | |
using System.Data; | |
namespace Derp.Model.UnitOfWork | |
{ | |
/// <summary> |
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
/// <summary> | |
/// A simple service locator implementation | |
/// </summary> | |
public class ServiceLocator : IServiceLocator | |
{ | |
//A List of the registered services | |
private IDictionary<object, object> _services; | |
public ServiceLocator() { | |
_services = new Dictionary<object, object>(); |
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 InMemoryDbSet<T> : IDbSet<T> where T : class | |
{ | |
readonly HashSet<T> _set; | |
readonly IQueryable<T> _queryableSet; | |
public InMemoryDbSet() : this(Enumerable.Empty<T>()) { } | |
public InMemoryDbSet(IEnumerable<T> entities) { |
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
function dstBounds(date, month) { | |
var d = new Date(date.getFullYear(),/*March*/(month-1),31), | |
day = d.getDay(); | |
if (day != 0) d.setDate(d.getDate()-day); | |
//Dst starts @(UTC 01:00) | |
//this implementation is in UTC+1 (02:00) | |
d.setHours(2); | |
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
interface IRepository<T> where T : class | |
{ | |
void Add(T o); | |
void Commit(); | |
System.Linq.IQueryable<T> Get(); | |
void Remove(T o); | |
} | |
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
/* | |
* A cubic extrapolator using the polynomial | |
* P(T) = aT^2 + bT + c | |
*/ | |
function Extrapolator() { | |
this.s = []; | |
this.t = []; | |
this.sol = []; | |
}; |
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
function Interpolator(type) { | |
this._i = type.func; | |
this._snum = type.samples; | |
this.s = []; //Samples | |
}; | |
Interpolator.prototype.addSample = function(sample){ | |
var p = this.s; | |
p.push(sample); | |
if(p.length > this._snum) p.shift(); |