Skip to content

Instantly share code, notes, and snippets.

@srkirkland
srkirkland / EqualToAttribute.cs
Created March 16, 2011 04:52
Extending the equal to attribute to use the display name (from model metadata)
using System;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Reflection;
using DataAnnotationsExtensions.Resources;
namespace DataAnnotationsExtensions
{
/// <summary>
@srkirkland
srkirkland / form.html
Created March 16, 2011 22:18
Desired Html structure for a form, excluding the fieldset stuff. Label only has the required class & matching span if required.
<ul>
<li>
<div class="editor-label required">
<label>Text Field: </label><span>*</span>
</div>
<div class="editor-field">
<input type="text" value="Default" id="CompanyName">
<span class="field-validation-error">The CompanyName field is required.</span>
</div>
</li>
@srkirkland
srkirkland / MessageServiceClasses.cs
Created March 21, 2011 20:56
Attribute for adding the result of a server message remote call to cache
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class MessageServiceClient : System.ServiceModel.ClientBase<IMessageService>, IMessageService
{
public MessageServiceClient()
{
}
public MessageServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName)
using System.Collections.Generic;
using System.DirectoryServices.Protocols;
using System.Linq;
using System.Net;
using System.Text;
using System.Web.Configuration;
namespace Catbert4.Services
{
public interface IDirectorySearchService
@srkirkland
srkirkland / nhproxyerror.txt
Created August 2, 2011 18:05
Error with proxy during batching
[InvalidCastException: Unable to cast transparent proxy to type 'System.Data.SqlClient.SqlCommand'.]
NHibernate.AdoNet.SqlClientBatchingBatcher.AddToBatch(IExpectation expectation) +255
NHibernate.Persister.Collection.AbstractCollectionPersister.PerformInsert(Object ownerId, IPersistentCollection collection, IExpectation expectation, Object entry, Int32 index, Boolean useBatch, Boolean callable, ISessionImplementor session) +355
NHibernate.Persister.Collection.AbstractCollectionPersister.Recreate(IPersistentCollection collection, Object id, ISessionImplementor session) +305
NHibernate.Action.CollectionRecreateAction.Execute() +151
NHibernate.Engine.ActionQueue.Execute(IExecutable executable) +42
NHibernate.Engine.ActionQueue.ExecuteActions(IList list) +59
NHibernate.Engine.ActionQueue.ExecuteActions() +60
NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session) +121
NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) +92
@srkirkland
srkirkland / HomeController.cs
Created August 2, 2011 22:55
NHibernate and mini-profiler integration test
using System;
using System.Web.Mvc;
using FluentNHibernate.Cfg;
using FluentNHibernate.Mapping;
using NhProfilerProxy.Helpers;
namespace NhProfilerProxy.Controllers
{
public class HomeController : Controller
{
@srkirkland
srkirkland / shibboleth2.xml
Created August 5, 2011 17:14
shibboleth config file
<SPConfig xmlns="urn:mace:shibboleth:2.0:native:sp:config"
xmlns:conf="urn:mace:shibboleth:2.0:native:sp:config"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
clockSkew="180">
<!--
The InProcess section contains settings affecting web server modules.
Required for IIS, but can be removed when using other web servers.
@srkirkland
srkirkland / attribute-map.xml
Created August 9, 2011 22:02
Shibbleth2 xml config for url (using test shib)
<Attributes xmlns="urn:mace:shibboleth:2.0:attribute-map" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.6" id="eppn">
<AttributeDecoder xsi:type="ScopedAttributeDecoder"/>
</Attribute>
<Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.9" id="affiliation">
<AttributeDecoder xsi:type="ScopedAttributeDecoder" caseSensitive="false"/>
</Attribute>
<Attribute name="urn:oid:0.9.2342.19200300.100.1.3" id="mail"/>
<Attribute name="urn:oid:2.16.840.1.113730.3.1.241" id="displayName"/>
@srkirkland
srkirkland / NewUsers.txt
Created August 10, 2011 23:42
Template Emails for Recruitment Questions
<Name>,
The first step I recommend is to have interested parties watch an introductory screencast video which explains the Recruitment application and its features. You can find that video here: https://secure.caes.ucdavis.edu/help/Help/WatchVideo/4?appName=Recruitment.
When you are finished watching the video, email recruitments@caes.ucdavis.edu and you'll be given access to our Recruitment test site, which looks exactly like the real thing (but with fake data), and you can play around with the system functionality. This includes things like creating positions, applying to them as imaginary applicants, emailing, reports, committees, etc. After a while once you are comfortable with the system I'll give you access to the production system under your departments only (note: there can be any number of people given access, and each can have multiple departments). Also, if this is a department who hasn't used the Recruitment system before I'll get a customized image (and other opti
@srkirkland
srkirkland / prepurchasingdb.sql
Created August 19, 2011 16:23
SQL script for generating pre purchasing
USE [PrePurchasing]
GO
/****** Object: Table [dbo].[UsersXOrganizations] Script Date: 08/19/2011 09:22:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UsersXOrganizations](