Skip to content

Instantly share code, notes, and snippets.

View codeprogression's full-sized avatar

Richard Cirerol codeprogression

View GitHub Profile
@codeprogression
codeprogression / csharp.gitignore
Created February 26, 2011 07:21
.gitignore for .NET projects
# .gitignore for .NET projects
# Thanks to Derick Bailey
# http://www.lostechies.com/blogs/derickbailey/archive/2009/05/18/a-net-c-developer-s-gitignore-file.aspx
# Additional Thanks to
# - Alexey Abramov
# Standard VS.NET and ReSharper Foo
[Oo]bj
[Bb]in
*.csproj.user
@codeprogression
codeprogression / rakefile.rb
Created March 20, 2011 20:46
basic rakefile for building and deploying an asp.net web application
require 'rubygems'
require 'erb'
require 'fileutils'
require 'find'
require 'rake'
require 'rake/tasklib'
task :default do
package_location="sample/" # website folder location relative to checkout root
project_file = "sample/sample.csproj" # website project location relative to checkout root
@codeprogression
codeprogression / Bootstrapper.cs
Created June 24, 2011 13:53
StructureMapBootstrapper for WPF Prism Applications
using System;
using System.Windows;
using Microsoft.Practices.Prism.Modularity;
namespace CodeProgression.Common.Prism
{
public class Bootstrapper : StructureMapBootstrapper
{
protected override void ConfigureContainer()
{
<!--
***********************************************************************************************
Microsoft.Web.Publishing.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your web deploy projects from the command-line or the IDE.
This file defines the steps in the standard build process to deploy web application projects.
@codeprogression
codeprogression / DifferenceWithFluentNHibernate.cs
Created July 7, 2011 04:31
RoundhousE RefreshDatabase.fnh with Automapping
// ==============================================================================
//
// Fervent Coder Copyright © 2011 - Released under the Apache 2.0 License
//
// Adaption by Code Progression Copyright © 2011 - Released under the Apache 2.0 License
//
// Copyright 2007-2008 The Apache Software Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
@codeprogression
codeprogression / hulu-snl.js
Created July 15, 2011 21:55
JSON response from Hulu for SNL skit
{
"duration": 102.7,
"type": "video",
"provider_url": "http://www.hulu.com/",
"embed_url": "http://www.hulu.com/embed/YdmSIZmY6plQhyhHSceW2A",
"author_name": "NBC",
"cache_age": 3600,
"height": 200,
"width": 115,
"html": "<object width="200" height="115"><param name="movie"
using System;
using System.Collections.Generic;
using System.Data;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using FluentNHibernate.Mapping;
using NHibernate;
using NHibernate.Tool.hbm2ddl;
namespace SO6727128
using System;
using System.Collections.Generic;
using System.Data;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using FluentNHibernate.Mapping;
using HibernatingRhinos.Profiler.Appender.NHibernate;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using System;
using System.Collections.Generic;
using System.Data;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using FluentNHibernate.Mapping;
using HibernatingRhinos.Profiler.Appender.NHibernate;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
@codeprogression
codeprogression / ContentNegotiationExtensions.cs
Created February 28, 2012 12:14
Adding alternative responses to the NancyContext.Items dictionary
public static void AddAlternateResponses<T>(this NancyContext context, T resource,
HttpStatusCode statusCode = HttpStatusCode.OK, string location = null)
{
var xmlResponse = new XmlResponse<T>(resource, "application/xml", new DefaultXmlSerializer())
{
StatusCode = statusCode
};
var jsonResponse = new JsonResponse(new { resource }, new DefaultJsonSerializer())
{
StatusCode = statusCode