Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
ryanvgates / Doesn't Work
Created November 4, 2015 04:52
Nuget Update-Package Gotcha Doesn't Work
Update-Package FluentValidation
@ryanvgates
ryanvgates / httpModule.cs
Last active December 7, 2015 05:19
HttpModule for handling IFrame
using System;
using System.Linq;
using System.Web;
using System.Configuration;
namespace XFrameOptionsHttpModule {
public class XFrameOptionsHeaderModule: IHttpModule {
private HttpApplication context;
private const string XFrameOptionsHeader = "X-Frame-Options";
private const string XFrameOptionsSameOrigin = "SAMEORIGIN";
@ryanvgates
ryanvgates / Build Error
Created February 18, 2016 18:15
Gated Check-In Nuget Error
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605): The primary reference "\bin\Library.dll" could not be resolved because it has an indirect dependency on the assembly "NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605): The primary reference "\bin\Library.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "\bin\Library.dll" or retarget your application to a framework version which contains "System.IO.Compression, Version=4.0.0.0, Culture=neutral,
@ryanvgates
ryanvgates / DeploymentEmail.ps1
Last active May 11, 2016 04:37
Powershell and TFS Deployment Email
$From = $env:username + "@domain.com"
$TFSServer = "http://tfsServer:8080/tfs/Collection"
$body = ""
$Subject = "IMPORTANT: QA DEPLOYMENT for Your Site Announcement COMPLETE"
$recipients = $From
#Prevent e-mails from going out before you are ready
#$recipients = "Deployment QA Distribution List"
$cc = ""
$bcc = $From
$Pbis = "10899", "10950" #enter PBI's here
@ryanvgates
ryanvgates / BackupAndCopy.psm1
Last active September 10, 2016 03:28
Powershell Backup And Copy
#
# BackupAndCopy.psm1
#
function BackupAndCopy
{
[cmdletbinding(SupportsShouldProcess=$True)]
param([string]$source, [string]$destination, [string]$backup)
$backupPath = $("$backup\") + $(Split-Path $destination -Leaf) + "_"+ $(get-date -Format MM-dd-yyy_HH-mm-ss) + "\"
@ryanvgates
ryanvgates / .runsettings.correct
Last active February 23, 2017 04:57
Making Chutzpah and TFS get along
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<ChutzpahAdapterSettings>
<EnabledTracing>true</EnabledTracing>
</ChutzpahAdapterSettings>
</RunSettings>
@ryanvgates
ryanvgates / error
Last active December 26, 2016 02:57
TFS Build Error TF30063
TF215097: An error occurred while initializing a build for build definition Build.Test:
Exception Message: TF30063: You are not authorized to access Microsoft-IIS/8.5. (type TeamFoundationServerUnauthorizedException)
Exception Stack Trace:
at Microsoft.TeamFoundation.VersionControl.Client.UploadDownload.EndGetDownloadStream(IAsyncResult asyncResult)
at Microsoft.TeamFoundation.VersionControl.Client.UploadDownload.RetryDownloadStream.AcquireStreamAndSeek(Int64 offset)
at Microsoft.TeamFoundation.VersionControl.Client.UploadDownload.RetryDownloadStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadToEnd()
at Microsoft.TeamFoundation.Build.Client.ProcessTemplate.Download(String sourceGetVersion)
at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest
@ryanvgates
ryanvgates / .runsettings.incorrect
Created February 23, 2017 04:54
.runsettings.incorrect
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<ChutzpahAdapterSettings>
<EnabledTracing>True</EnabledTracing>
</ChutzpahAdapterSettings>
</RunSettings>
@ryanvgates
ryanvgates / NoIFrameForYou.cs
Last active April 6, 2018 04:35
No IFrame For You
using System;
using System.Linq;
using System.Web;
using System.Configuration;
namespace XFrameOptionsHttpModule
{
public class XFrameOptionsHeaderModule : IHttpModule
{
private HttpApplication context;
@ryanvgates
ryanvgates / Get File Dimensions
Last active June 6, 2017 01:36
FFMPEG Slideshow
file *.jpg > out.txt