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 Newtonsoft.Json; | |
using System.Net; | |
using System.Net.Http; | |
using System.Text; | |
using System.Web.Http; | |
namespace DocSol.Webservice.Controllers | |
{ | |
public class ClientError : HttpResponseException | |
{ |
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 MyNamespace = (function(namespace) { | |
if (!Array.prototype.filter) { | |
Array.prototype.filter = function(fun /*, thisp */) { | |
"use strict"; | |
if (this == null) throw new TypeError(); | |
var t = Object(this); | |
var len = t.length >>> 0; |
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 ajax = (function (ajax, json) { | |
ajax.send = function (obj) { | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.onreadystatechange = function () { | |
if (xmlhttp.readyState == 4) { | |
if (xmlhttp.status >= 200 && xmlhttp.status < 300 && obj.complete) { | |
obj.complete(json.parse(xmlhttp.responseText)); | |
} | |
if (xmlhttp.status < 200 || xmlhttp.status >= 300) { |
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
<system.diagnostics> | |
<sources> | |
<source name="System.Net" tracemode="protocolonly" maxdatasize="1024"> | |
<listeners> | |
<add name="System.Net"/> | |
</listeners> | |
</source> | |
<source name="System.Net.Sockets"> | |
<listeners> | |
<add name="System.Net"/> |
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 class WebApiApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
//... | |
GlobalConfiguration.Configuration.MessageHandlers.Add(new TaskCanceledExceptionHandler()); | |
} | |
} |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var bus = RabbitHutch.CreateBus("host=localhost")) | |
{ | |
var subscriber = new AutoSubscriber(bus, "Subscriber"); | |
subscriber.SubscribeAsync(Assembly.GetExecutingAssembly()); | |
Console.WriteLine("Listening for messages. Hit <return> to quit."); | |
Console.ReadLine(); |
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 class ImageProcessRequestConsumer : IConsumeAsync<ImageProcessRequest> | |
{ | |
Command command = new Command("connectionString"); | |
public async Task Consume(ImageProcessRequest message) | |
{ | |
await command.ExecuteScalarAsync( | |
@"Insert into Images(TrackingNumber, Format, Image) | |
Values(@TrackingNumber, @Format, @Image)", | |
message); |
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 class RabbitMQ | |
{ | |
public static IBus Bus { get; private set; } | |
static RabbitMQ() | |
{ | |
Bus = RabbitHutch.CreateBus("host=localhost"); | |
} | |
} |
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 class TemporaryDirectory : IDisposable | |
{ | |
readonly string _directory; | |
public TemporaryDirectory() | |
{ | |
_directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); | |
Directory.CreateDirectory(_directory); | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<title>Animated Hierarchy</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
</head> |
OlderNewer