Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Web.Mvc;
using UCDArch.Core.PersistanceSupport;
using UCDArch.Web.Controller;
using UCDArchTemplates.Models;
using UCDArch.Web.Helpers;
namespace UCDArchTemplates.Controllers
{
/// <summary>
using System;
using System.Web.Mvc;
using UCDArch.Core.PersistanceSupport;
using UCDArch.Web.Controller;
using UCDArchTemplates.Models;
using UCDArch.Web.Helpers;
namespace UCDArchTemplates.Controllers
{
/// <summary>
@srkirkland
srkirkland / BingSpellingSuggestion.htm
Created February 24, 2010 23:33
Bing Spelling API Example
<script type="text/javascript">
$(function() {
$("#checkSpelling").click(function(event) {
var text = $("#query").val();
var encodedText = escape(text);
var spellService = "http://api.bing.net/json.aspx?AppId=APIKey&Query=" + encodedText + "&Sources=Spell&Version=2.0&Market=en-us&Options=EnableHighlighting&JsonType=callback&JsonCallback=SearchCompleted";
$.getScript(spellService);
@srkirkland
srkirkland / jqvalRegEx.js
Created February 25, 2010 18:00
Some jQuery Val Expressions
//jQuery Validator Regular Expressions
// Email Regular Expression
^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$
//URL RegEx
^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_
@srkirkland
srkirkland / TransferFSNEPtoFSNEP2.sql
Created April 27, 2010 22:49
FSNEP Data Export Script
IF object_id('tempdb..#records') IS NOT NULL
BEGIN
DROP TABLE #records
END
CREATE TABLE #records
(
new_id int IDENTITY(1,1),
old_id int,
[type] char(1),
IF object_id('tempdb..#records') IS NOT NULL
BEGIN
DROP TABLE #records
END
CREATE TABLE #records
(
new_id int IDENTITY(1,1),
old_id int,
[type] char(1),
declare @el table
(
new_id int identity(1,1),
old_id int
)
-- transfer the information from the time/expense sheets
begin transaction
begin try
USE [FSNEPv2]
GO
/****** Object: StoredProcedure [dbo].[usp_NotifyUsersOfSemiAnnualCertification] Script Date: 05/12/2010 10:47:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[usp_NotifyUsersOfSemiAnnualCertification]
public DataNamMap()
{
Table("DataNams");
ReadOnly();
Id(x => x.Id).GeneratedBy.Guid();
Map(x => x.NamNumber);
Map(x => x.Department);
Map(x => x.Status);
public IList<SearchStudent> SearchStudentByLogin(string login, string termCode)
{
var searchQuery = NHibernateSessionManager.Instance.GetSession().GetNamedQuery("SearchStudentByLogin");
searchQuery.SetString("login", login);
searchQuery.SetString("term", termCode);
return searchQuery.List<SearchStudent>();
}