This file contains hidden or 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
const fs = require('fs'); | |
function logReqRes(req, res, next) { | |
const oldWrite = res.write; | |
const oldEnd = res.end; | |
const chunks = []; | |
res.write = (...restArgs) => { | |
chunks.push(Buffer.from(restArgs[0])); | |
oldWrite.apply(res, restArgs); |
This file contains hidden or 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
// Extension Method to create a zip from a DirectoryInfo using .NET's System.IO.Compression - ZipArchive | |
public static class Extensions | |
{ | |
public static byte[] CreateZip(this DirectoryInfo directory) | |
{ | |
byte[] result = null; | |
using (MemoryStream stream = new MemoryStream()) | |
{ | |
using (var archive = new ZipArchive(stream, ZipArchiveMode.Create, true)) | |
{ |
This file contains hidden or 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
private bool TestForServer(string address, int port) | |
{ | |
int timeout = 500; | |
if (ConfigurationManager.AppSettings["RemoteSQLServerTestTimeout"] != null) | |
int.TryParse(ConfigurationManager.AppSettings["RemoteSQLServerTestTimeout"], out timeout); | |
var result = false; | |
try | |
{ | |
using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<sectionGroup name="common"> | |
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> | |
</sectionGroup> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> | |
</configSections> | |
<appSettings> |