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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
new Program().Run(args); | |
} | |
private WindsorContainer _container; | |
public void Run(string[] args) | |
{ |
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.Web; | |
using NHibernate; | |
using NHibernate.Context; | |
using NHibernate.Engine; | |
namespace WebHub.Infrastracture.SessionManagement | |
{ | |
public class LazySessionContext : ICurrentSessionContext |
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 BitWriter | |
: BinaryWriter | |
{ | |
public BitWriter(Stream output) : base(output) | |
{ | |
} | |
public void Write7BitInt(int value) | |
{ | |
Write7BitEncodedInt(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
require.config({ | |
paths: { | |
underscore: '../underscore-min' | |
}, | |
shim: { | |
underscore: { | |
exports: function() { | |
return _.noConflict(); | |
} | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
static void TreatConfiguration(NHibernate.Cfg.Configuration configuration) | |
{ | |
var update = new SchemaUpdate(configuration); | |
update.Execute(false, true); | |
} | |
private void Configure() | |
{ |
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 NhSessionManagementAttribute : ActionFilterAttribute | |
{ | |
public NhSessionManagementAttribute() | |
{ | |
SessionFactory = MvcApplication.SessionFactory; | |
} | |
private ISessionFactory SessionFactory { get; set; } | |
public override void OnActionExecuting(HttpActionContext actionContext) |
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
<p data-bind="markdown: content></p> | |
or | |
<p data-bind="markdown: {text:content,options: { maxLength:500 }}></p> |
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 deferred = $.Deferred(); | |
promise = deferred.promise(); | |
promise = promise.then(function(){ | |
var t = $.Deferred(); | |
setTimeout(function() { | |
console.log('rejecting...'); | |
t.reject(); | |
}, 1000); |
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 FooEntity | |
: IHaveEvents | |
{ | |
private readonly IList<IEvent> _events = new List<IEvent>(); | |
private readonly ICollection<FooMember> _members = new HashedSet<FooMember>(); | |
public virtual Guid Id { get; protected set; } | |
public virtual IEnumerable<FooMember> Members { get { return _members; } } | |
public IList<IEvent> Events { get { return _events; } } |
OlderNewer