Skip to content

Instantly share code, notes, and snippets.

@chadmyers
chadmyers / install_rewrite_on_win10.ps1
Created June 15, 2016 22:59
Install IIS UrlRewrite 2.0 on Windows 10
(new-object net.webclient).DownloadFile("https://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi", "$env:TEMP\rewrite_2.0x64.msi")
Push-Location HKLM:\Software\Microsoft\InetStp
$prevMajorVer = Get-ItemProperty -path . | Select -expandproperty MajorVersion
Set-ItemProperty . MajorVersion 9
$process = start-process "msiexec" -windowstyle Hidden -ArgumentList "/i $env:TEMP\rewrite_2.0x64.msi /quiet /norestart /qn" -PassThru -Wait
$result = $process.ExitCode
Set-ItemProperty . MajorVersion $prevMajorVer
Pop-Location
iisreset
@chadmyers
chadmyers / keybase.md
Created May 18, 2016 14:49
keybase.md

Keybase proof

I hereby claim:

  • I am chadmyers on github.
  • I am chadmyers (https://keybase.io/chadmyers) on keybase.
  • I have a public key whose fingerprint is 38A9 4643 3445 11D1 4066 08EF CF18 25B0 9AFE 7FA3

To claim this, I am signing this object:

@chadmyers
chadmyers / sample.cs
Created August 13, 2012 14:38
SAML sample code
var signedXml = new SignedXml(_rawXml);
var publicKey = cert.PublicKey.Key;
var signatureElement = (XmlElement) _rawXml
.GetElementsByTagName("Signature","http://www.w3.org/2000/09/xmldsig#")
.First();
signedXml.LoadXml(signatureElement);
// I've tried it both ways (using the embedded key)
@chadmyers
chadmyers / WrapIfFirstCallMatchesPolicy.cs
Created July 2, 2012 16:37
WrapIfFirstCallMatchesPolicy
public class WrapIfFirstCallMatchesPolicy<TWrapperBehavior> : IConfigurationAction where TWrapperBehavior : IActionBehavior
{
readonly Func<ActionCall, bool> _filter;
public WrapIfFirstCallMatchesPolicy(Func<ActionCall, bool> filter )
{
_filter = filter;
}
public bool Matches(BehaviorChain chain)
@chadmyers
chadmyers / Login.aspx
Created March 9, 2012 16:16
Dovetail use of FubuLocalization
<div id="login-header">
<h1>Dovetail Software</h1>
<h2 id="login-title"><%: UserMessageKeys.AGENT_LOGIN_HEADING %></h2>
</div>
using System;
using System.Reflection;
using FubuCore.Reflection;
namespace FubuCore.Binding
{
public class MapWebToPhysicalPathFamily : StatelessConverter
{
public override bool Matches(PropertyInfo property)
{
@chadmyers
chadmyers / Test1.aspx
Created November 29, 2011 17:10
Cookie delete test
<%@ Page language="C#" %>
<%
Response.Cookies["marektest"].Value = "marek";
Response.Redirect("test2.aspx");
%>
@chadmyers
chadmyers / bod.coffee
Created November 23, 2011 21:20
BOD Hubot Coffee
# Allows Hubot to give a look of disapproval.
#
# bod <name> - gives back the character for the look of disapproval.
module.exports = (robot) ->
robot.respond /bod\s?(.*)/i, (msg) ->
user_msg = msg.match[1].trim()
response = 'ಠ_ಠ - ' + user_msg + '\n' +
@chadmyers
chadmyers / gist:1243574
Created September 26, 2011 22:19
Installing services
setlocal
SET INSTANCE_NAME=HRRuss
CD c:\dovetailcrm\%INSTANCE_NAME%
pushd services\DovetailCRM.EmailEngine.Service
DovetailCRM.EmailEngine.Service.exe /install
@chadmyers
chadmyers / SMBug.cs
Created June 28, 2011 21:47 — forked from jmarnold/SMBug.cs
SM Bug
using System;
using System.Diagnostics;
using System.Linq;
using StructureMap;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)