Skip to content

Instantly share code, notes, and snippets.

View samdelagarza's full-sized avatar

Sam De La Garza samdelagarza

View GitHub Profile
Simple dotless pre-build event command line in Mvc2 Proj file:
$(SolutionDir)..\lib\dotless\dotless.compiler.exe $(ProjectDir)content\site.less $(ProjectDir)content\site.css
_sessionFactory =
Fluently.Configure()
.Database(SQLiteConfiguration.Standard.ShowSql().InMemory())
.Mappings(m => m.FluentMappings.AddFromAssembly(assemblyContainingMapping))
.ExposeConfiguration(cfg => new SchemaExport(cfg).Execute(true, true, false))
.BuildSessionFactory();
_sessionFactory =
Fluently.Configure()
.Database(SQLiteConfiguration.Standard.ShowSql().InMemory())
.Mappings(m => m.FluentMappings.AddFromAssembly(assemblyContainingMapping))
.ExposeConfiguration(cfg => new SchemaExport(cfg).Execute(true, true, false, _session.Connection, Console.Out))
.BuildSessionFactory();
public class InMemoryDatabaseTest : IDisposable
{
private static Configuration _cfg;
private static ISessionFactory _sessionFactory;
protected ISession _session;
public InMemoryDatabaseTest(Assembly assemblyContainingMapping)
{
if (_sessionFactory == null)
{
Fluently.Configure().Database(MsSqlConfiguration.MsSql2008
.ConnectionString(c => c
.Server(@"localhost\SQLEXPRESS")
.Database("foo")
.Username("foo")
.Password("foo")))
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<FooMap>()
.Conventions.Add(FluentNHibernate.Conventions.Helpers.Table.Is(x => "foos"))
)
<body>
<div id="Container">
<div id="Header">
<div id="TopNav">
<div class="wrapper">
Download at: [codeplex link here] <span><a href="#">Overview</a></span> <span><a
href="#">Screencasts</a></span> <span><a href="#">Api Documentation</a></span>
</div>
</div>
<div id="MastHead">
Use.Transaction(GetSessionFactory(facilityId), session => {
facilityName = session
.Linq<FacilityHierarchy>()
.Where(x => x.FACID == facilityId)
.Select(x => x.DOM_NAME)
.SingleOrDefault();
});
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
criteria.formbuilder = (function () {
var reloadCriteria = function () {
console.log('hi');
};
return {
reloadCriteria: reloadCriteria,
};
require 'rubygems'
require 'albacore'
task :default => :build
msbuild :build do |msb|
msb.solution = "source/ContractManager.sln"
msb.targets :clean, :build
msb.properties :configuration => :release
end