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 EnvDTE; | |
namespace VSBouncer | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var command = args[0]; |
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 class ServiceStackTextFormatter : MediaTypeFormatter | |
{ | |
public ServiceStackTextFormatter() | |
{ | |
// Fill out the mediatype and encoding we support | |
SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/json")); | |
Encoding = new UTF8Encoding(false, true); | |
} | |
protected override Task<object> OnReadFromStreamAsync(Type type, Stream stream, HttpContentHeaders contentHeaders, FormatterContext formatterContext) |
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
<!-- add this target to *each* project file, and modify the BeforeBuild target that's already in the project file (usually commented out) to depend on it --> | |
<Target Name="RestoreNuGetPackages" Condition="Exists('.\packages.config')"> | |
<!-- try to execute `nuget help` to see if it's available from what's in the PATH --> | |
<Exec Command="cmd.exe /c nuget help > NUL" IgnoreExitCode="True"> | |
<Output TaskParameter="ExitCode" PropertyName="NuGetExitCode"/> | |
</Exec> | |
<!-- raise an error if nuget.exe wassn't available from what's in the PATH --> | |
<Error Text="Failed to execute nuget.exe; please make sure your PATH environment variable provides a path to nuget.exe." Condition="'$(NuGetExitCode)' != '' and '$(NuGetExitCode)' > '0'" /> | |
<!-- restore packages --> | |
<Exec Command="nuget install .\packages.config -o $(SolutionDir)\packages" /> |
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.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using ContactManager.Models; | |
namespace ContactManager.Controllers | |
{ | |
public class ContactController : ApiController | |
{ |
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.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using ContactManager.Models; | |
namespace ContactManager.Controllers | |
{ | |
public class ContactsController : ApiController |
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"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir> | |
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath> | |
<NuGetExePath>$(NuGetToolsPath)\nuget.exe</NuGetExePath> | |
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig> | |
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir> | |
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir> |
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 class ThroughputMessageHandler : DelegatingHandler | |
{ | |
private readonly ILogger _logger; | |
private Timer _timer; | |
private int _count; | |
public ThroughputMessageHandler(ILogger logger) | |
{ | |
_logger = logger; | |
_count = 0; | |
_timer = new Timer(new TimerCallback(timerCallback),null,1000,1000); |
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 EnvDTE; | |
namespace VSBouncer | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var command = args[0]; |
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
@helper ItemBuild(string menuItemText, string controllerName, string actionName){ | |
var controller = ViewContext.Controller.ValueProvider.GetValue("controller").RawValue; | |
var action = ViewContext.Controller.ValueProvider.GetValue("action").RawValue; | |
<li @(controller.Equals(controllerName) && action.Equals(actionName) ? "class=selected" : string.Empty)>@Html.ActionLink(menuItemText, actionName, controllerName)</li>} |
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
md RenameTest | |
cd RenameTest | |
git init | |
md FolderV1 | |
echo Test1 > FolderV1\FileV1.txt | |
echo Test2 > FolderV1\FileV2.txt | |
git add -A | |
git commit -m "inital commit" | |
(git) mv FolderV1\FileV1.txt FolderV1\FileV1a.txt | |
(git) mv FolderV1\FileV2.txt FolderV1\FileV2a.txt |