This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Radar.Common.WebServer.Api.Controllers | |
{ | |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Filters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM: EOF in C:\Windows\System32\config.nt | |
COUNTRY=039,850,C:\Windows\System32\COUNTRY.SYS | |
REM: EOF in C:\Windows\System32\autoexec.nt | |
C:\Windows\System32\KB16 IT,850,C:\Windows\System32\KEYBOARD.SYS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$('span.field-validation-valid, span.field-validation-error').each(function () { | |
$(this).addClass('help-inline'); | |
}); | |
$('.validation-summary-errors').each(function () { | |
$(this).addClass('alert'); | |
$(this).addClass('alert-error'); | |
$(this).addClass('alert-block'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @name VARCHAR(50) -- database name | |
DECLARE @path VARCHAR(256) -- path for backup files | |
DECLARE @fileName VARCHAR(256) -- filename for backup | |
DECLARE @fileDate VARCHAR(20) -- used for file name | |
-- specify database backup directory | |
SET @path = 'C:\Backups\' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
//Extra ignores to support WCF in ASP.NET MVC | |
routes.IgnoreRoute("{resource}.svc/{*pathInfo}"); | |
routes.IgnoreRoute("{resource}.svc"); | |
routes.MapRoute( | |
name: "Default", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = from order in context.Orders | |
group order by new { order.Customer , order.OrderDate } into ordersForCustomer | |
select | |
new | |
{ | |
Key1 = ordersForCustomer.Key.Customer, | |
Key2=ordersForCustomer.Key.OrderDate, | |
Count=ordersForCustomer.Count() | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chartData = from log in _contextProvider.Context.Logs | |
group log by new | |
{ | |
ApplicationName=log.Application.Name, | |
Year= SqlFunctions.DatePart("Year", log.Timestamp), | |
Month= SqlFunctions.DatePart("Month",log.Timestamp) | |
} | |
into logsPerApplication | |
select new | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using System.Reflection; | |
namespace MimeHelpers | |
{ | |
internal static class Mime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace EntityExtensions { | |
public class FakeDbSet<T> : System.Data.Entity.IDbSet<T> where T : class { | |
private readonly List<T> list = new List<T>(); | |
public FakeDbSet() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Nancy.ModelBinding; | |
public class DynamicModelBinder : IModelBinder | |
{ | |
public object Bind(NancyContext context, Type modelType, object instance, BindingConfig configuration, params string[] blackList) | |
{ | |
var data = |