Skip to content

Instantly share code, notes, and snippets.

View tncbbthositg's full-sized avatar

D. Patrick Caldwell tncbbthositg

View GitHub Profile
@tncbbthositg
tncbbthositg / gist:2031107
Created March 13, 2012 19:44
Confirming action with a popup...
// Usage examples
//
// Calls the default asp.net event for the control
// OnClientClick = "return confirmAction('Are you sure?', this);"
//
// Uses your own function
// OnClientClick = "return confirmAction('Are you sure?', function() { window.alert('No Way!'); });"
//
// Uses built in browser confirmation
// OnClientClick = "return confirmAction('Are you sure?');"
// basic example
$('span').filter(function() {
return this.innerHTML.match(/\b(fire|aqua|elec|wood)\b/gi);
}).css("border", "1px solid red");
// styling each individual word
var fire = "<span style='border: 3px solid red;'>fire</span>";
var aqua = "<span style='border: 3px solid blue;'>aqua</span>";
var elec = "<span style='border: 3px solid gray;'>elec</span>";
[TestMethod]
public void TestIQueryableExtensions()
{
var folks = new List<Person>();
folks.Add(new Person{ Id = 1, Name = "Patrick" });
folks.Add(new Person { Id = 2, Name = "James" });
Assert.AreEqual(folks.GetById(1).Name, "Patrick");
Assert.AreEqual(folks.GetById(2).Name, "James");
public static class EntityItemExtension
{
public static TEntity GetById<TEntity>(this IEnumerable<TEntity> source, int id)
where TEntity : class, IEntityItem
{
return source.First(e => e.Id.Equals(id));
}
public static void Save<TEntity>(this TEntity entity)
where TEntity : class, IEntityItem
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PayrollYear = System.Int32;
using PayperiodNumber = System.Int32;
namespace TAS.SQL_DAL
{
public class PayrollYearInfo
[Serializable]
[AttributeUsage(AttributeTargets.Property)]
public class PropertyDefault : OnMethodInvocationAspect
{
private enum AccessorType
{
Get,
Set
}
namespace PropertyDefaultAttributeTestConsole
{
class Program
{
static void Main(string[] args)
{
Person pat = new Person();
Console.WriteLine(pat); // "Caldwell, Pat"
Console.WriteLine(pat.Fiance); // "Woody, Lauren"
using System.Configuration;
using TASNET_Interface.IDAL;
namespace TASNET_Interface
{
public class DALFactory : IDataAccess
{
private static string _dal = ConfigurationManager.AppSettings["Dal"];
private static IDataAccess _dataAccess;
<?php
$url = $_POST["ajaxproxy_url"];
unset($_POST["ajaxproxy_url"]);
if (isset($_POST["ajaxproxy_unpw"]))
{
$unpw = $_POST["ajaxproxy_unpw"];
unset($_POST["ajaxproxy_unpw"]);
}
CREATE TRIGGER Benefits.AddressHashcode
ON Benefits.Addresses
INSTEAD OF INSERT
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO addresses
SELECT City, State, Zip, Street1, Street2, County,
ISNULL(