Skip to content

Instantly share code, notes, and snippets.

@orjan
orjan / gist:182919
Created September 8, 2009 13:43
asp.net ajax request event
<script type="text/javascript">
function pageLoad() {
cbb.init();
/*$(document).ready();*/
}
</script>
@orjan
orjan / gist:183204
Created September 8, 2009 20:32
NH fluent configuration
ISessionFactory sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory)
.Mappings(m => m.AutoMappings.Add(
AutoMap.AssemblyOf<Entity>()
//.IncludeBase<Entity>()
.Where(t => t.Namespace.EndsWith("Domain"))
.IgnoreBase<Entity>()
//.Conventions.Add<MyStringLengthConvention>()
.Conventions.Add<MyIdConvention>()
))
@orjan
orjan / gist:199130
Created October 1, 2009 18:05
asp.net wizard api
public enum Steps
{
// Next and previous is always available if not the first step
Standard,
Verification,
// End-step, thanks for your order
Confirmation,
// End-step, Transition to cancel is always available but not from confirmation
Cancel
}
@orjan
orjan / gist:203410
Created October 6, 2009 20:59
NH DB configuration
<!-- Postgre Nhibernate -->
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.NpgsqlDriver</property>
<property name="connection.connection_string">
Server=localhost;Database=sharpdojjo;User ID=postgres;Password=xxx;
</property>
<property name="dialect">NHibernate.Dialect.PostgreSQL82Dialect</property>
<property name="show_sql">false</property>
<property name="connection.release_mode">auto</property>
<%= Html.Grid(EntityEnumerator.GetEntities(Model)).WithModel(new AllPropertiesAsColumns<Entity>(EntityEnumerator.GetEntities(Model)))%>
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using MvcContrib.UI.Grid;
using SharpArch.Core.DomainModel;
namespace SharpDojjo.Web.Helpers
using System;
using System.Web.UI;
namespace WebApplication.template
{
public class BasePage : Page
{
public BasePage()
{
HeaderControls = new ControlCollection(this);
using System;
using System.IO;
using Hornalen.Data.NHibernateMaps;
using Hornalen.Migration.Process;
using log4net;
using log4net.Config;
using Rhino.Etl.Core;
using SharpArch.Data.NHibernate;
namespace Hornalen.Migration
using System;
using System.Web;
using Autofac;
using Autofac.Integration.Web;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using Labs2.Dev.Burndown.Data;
using log4net.Config;
using NHibernate;
using NHibernate.Cfg;
public class GoogleSpreadsheetRowReader
{
private readonly SpreadsheetsService service;
public GoogleSpreadsheetRowReader(string username, string password)
{
service = new SpreadsheetsService("google-spreadsheet-reader");
service.setUserCredentials(username, password);
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full featured example using jQuery plugin</title>
<!-- Load jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">