Skip to content

Instantly share code, notes, and snippets.

@srkirkland
srkirkland / .gitignore
Created June 18, 2012 21:15
base git ignore file for .net projects
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
Purchasing.Web/bin/*
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
@srkirkland
srkirkland / .gitattributes
Created June 18, 2012 21:17
basic gitattributes file, with auto LF normalization
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
@srkirkland
srkirkland / quartz.cs
Created July 19, 2012 18:08
quartz timer and trigger example
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Threading;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.StorageClient;
@srkirkland
srkirkland / demo.txt
Created August 16, 2012 16:01
stuff to demo
Demo info:
https://test.caes.ucdavis.edu/PrePurchasing
Request Page, Landing Page, Order History, User Preferences
* Landing Page
*
* Login as self/postit
@srkirkland
srkirkland / accountcontroller.cs
Created August 28, 2012 22:15
general CAS authentication AccountController with UCDArch
using System.Web.Mvc;
using System.Web.Security;
using System.Web.Services.Description;
using Purchasing.Core.Domain;
using UCDArch.Web.Authentication;
namespace Sample.Web.Controllers
{
/// <summary>
/// Controller for the Account class
@srkirkland
srkirkland / deploy.ps1
Created September 10, 2012 22:18
TeamCity CI Deploy Azure PowerShell Script
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
Write-Output "Running Azure Imports"
@srkirkland
srkirkland / filtercontroller.cs
Created January 31, 2013 16:56
Attribute which restricts a controller to only allow access by specific IP addresses
using System;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MvcApplication23.Controllers
{
[FilterIP(AllowedIPs="169.237.124.124;169.237.124.125")]
public class HomeController : Controller
{
@srkirkland
srkirkland / smithersstop.cs
Created February 8, 2013 22:49
waiting for existing jobs to exit when worker role is stopped
public override void OnStop()
{
_roleLogger.Info("Worker Role Exiting");
_host.Stop();
var scheduler = StdSchedulerFactory.GetDefaultScheduler();
var executingJobs = scheduler.GetCurrentlyExecutingJobs();
if (executingJobs.Count > 0)
{
@srkirkland
srkirkland / cachesingeton.cs
Created April 22, 2013 18:37
Singleton for creating a cache factory for Azure Caching. Creates the DataCacheFactory only once and stores it in CacheFactory.Instance. Can then get a desired DataCache by calling CacheFactory.Instance.GetCache("CacheName");
public static class CacheFactory
{
/// <summary>
/// This is a thread-safe, lazy singleton. See http://www.yoda.arachsys.com/csharp/singleton.html
/// for more details about its implementation.
/// </summary>
public static DataCacheFactory Instance
{
get { return Nested.CacheFactory; }
}
@srkirkland
srkirkland / pickupdirectory.xml
Created May 31, 2013 16:11
aspnet pickup directory tester
<system.net>
<mailSettings>
<smtp deliveryMethod="SpecifiedPickupDirectory" from="[email protected]">
<specifiedPickupDirectory pickupDirectoryLocation="C:\Development\Mail" />
</smtp>
</mailSettings>
</system.net>