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
HttpWebRequest.DefaultWebProxy = new WebProxy("127.0.0.1", 8080) | |
{ | |
BypassProxyOnLocal = true, | |
Credentials = new NetworkCredential("user", "pass") | |
}; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using System.Web.Http.SelfHost; | |
using System.Threading; | |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var random = new Random(); | |
var firstnames = female; | |
for (int i = 0; i < 100; i++) | |
{ | |
if (random.Next()%2 == 0) firstnames = male; |
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
namespace ExposeAMefContainer | |
{ | |
using System; | |
using System.ComponentModel.Composition; | |
using System.ComponentModel.Composition.Hosting; | |
using System.ComponentModel.Composition.Primitives; | |
class Program | |
{ | |
static void Main(string[] args) |
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
Get-Process | Where-Object { $_.Name -eq "w3wp" } | Stop-Process -Force | |
Remove-Item -Recurse -Force D:\LogFiles\* |
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
public static string DataContractSerialize(object serializableObject) | |
{ | |
if (serializableObject == null) | |
{ | |
return null; | |
} | |
using (MemoryStream memoryStream = new MemoryStream()) | |
{ | |
DataContractSerializer serializer = new DataContractSerializer(serializableObject.GetType()); | |
serializer.WriteObject(memoryStream, serializableObject); |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ |
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
set BASE=C:\T | |
set TOMCAT_VERSION=7.0.27 | |
set WAR_NAME=HelloWorld.war | |
set JRE_LOCALZIP=jdk.zip | |
set JAVA_HOME=%BASE%\jre | |
set PATH=%PATH%;%JAVA_HOME%\bin | |
set TOMCAT_LOCALZIP=apache-tomcat-%TOMCAT_VERSION%-windows-x64.zip | |
set CATALINA_HOME=%BASE%\apache-tomcat-%TOMCAT_VERSION% |
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" standalone="no"?> | |
<ServiceDefinition xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" name="WindowsAzureProject"> | |
<WorkerRole name="WorkerRole1" vmsize="Medium"> | |
<Startup> | |
<!-- Sample startup task calling startup.cmd from the role's approot folder --> | |
<Task commandLine="util/.start.cmd startup.cmd" executionContext="elevated" taskType="simple"> | |
<Environment> | |
<Variable name="BASE"> | |
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/LocalResources/LocalResource[@name='TC']/@path"/> | |
</Variable> |
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
namespace chgeuer.WebRoleUtils | |
{ | |
using System; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public class RestartingProcessHost | |
{ | |
internal class ValueTypeWrapper<T> |