Skip to content

Instantly share code, notes, and snippets.

View xt0rted's full-sized avatar
🐛
finding all the bugs

Brian Surowiec xt0rted

🐛
finding all the bugs
View GitHub Profile
@xt0rted
xt0rted / install.ps1
Created July 14, 2014 19:32
Nancy.Viewengines.Razor.0.23.0
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath "GetNancyRazorBuildProviderPostBuildCmd.ps1")
# Get the current Post Build Event cmd
$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value
# Append our post build command if it's not already there
if (!$currentPostBuildCmd.Contains($NancyRazorBuildProviderPostBuildCmd)) {
$project.Properties.Item("PostBuildEvent").Value += $NancyRazorBuildProviderPostBuildCmd
@xt0rted
xt0rted / install.ps1
Created July 14, 2014 19:33
Nancy.Viewengines.Razor.0.23.1
param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
# Normalize project path before calling GetLoadedProjects as it performs a string based match
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects([System.IO.Path]::GetFullPath($project.FullName)) | Select-Object -First 1
@xt0rted
xt0rted / Program.cs
Last active December 14, 2015 18:09
Sample console app for JabbR.Client
using System;
using System.Net;
using System.Threading;
using JabbR.Client.Models;
namespace JabbR.Client.Sample
{
class Program
{
@xt0rted
xt0rted / SpringloopsHandler.cs
Last active December 17, 2015 20:29
kudu service hook handler for springloops.io
public class SpringloopsHandler : ServiceHookHandlerBase
{
public override DeployAction TryParseDeploymentInfo(HttpRequestBase request, JObject payload, string targetBranch, out DeploymentInfo deploymentInfo)
{
string deployer = payload.Value<string>("domain");
if (!"springloops.io".Equals(deployer, StringComparison.OrdinalIgnoreCase))
{
deploymentInfo = null;
return DeployAction.UnknownPayload;
}
@xt0rted
xt0rted / tslint-sample-output.xml
Created January 9, 2014 23:03
A grunt task to generate JSLint style reports for use with TeamCity's XML report processing. The code is based on the built-in tslint report formatters and https://github.com/Bartvds/tslint-path-formatter
<jslint>
<file name="App/app.ts">
<issue line="1" char="13" reason="missing whitespace"/>
<issue line="2" char="5" reason="comment must start with a space"/>
</file>
<file name="App/some-folder/data.ts">
<issue line="1" char="13" reason="missing whitespace"/>
<issue line="2" char="19" reason="missing whitespace"/>
<issue line="2" char="20" reason="missing whitespace"/>
<issue line="2" char="21" reason="expected variableDeclarator: 'SOME_VARIABLE' to have a typedef."/>
@xt0rted
xt0rted / console.reg
Created June 28, 2017 02:05
Monokai console theme
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
"ColorTable00"=dword:003e4849
"ColorTable01"=dword:00969483
"ColorTable02"=dword:002ee2a6
"ColorTable03"=dword:00efd966
"ColorTable04"=dword:007226f9
"ColorTable05"=dword:007226f9
"ColorTable06"=dword:0074dbe6
@xt0rted
xt0rted / applicationHost.xdt
Created October 15, 2017 01:12
applicationHost.xdt for Kudu to force HTTPS & remove custom/server headers
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<location path="%XDT_SITENAME%" xdt:Transform="InsertIfMissing" xdt:Locator="Match(path)">
<system.webServer xdt:Transform="InsertIfMissing">
<applicationInitialization xdt:Transform="InsertIfMissing">
<add initializationPage="/" xdt:Transform="InsertIfMissing" />
</applicationInitialization>
<httpProtocol xdt:Transform="InsertIfMissing">
<customHeaders xdt:Transform="InsertIfMissing">
@xt0rted
xt0rted / settings.reg
Last active May 4, 2018 22:40
Disable old versions of SSL and TLS on Windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0]
@xt0rted
xt0rted / ApplicationInsightsDeployment.ps1
Created June 7, 2018 03:33
Application Insights & Raygun deplotments
# Sample usage .\CreateReleaseAnnotation.ps1 -applicationId "<appId>" -apiKey "<apiKey>" -releaseName "<releaseName>" -releaseProperties @{"ReleaseDescription"="Release with annotation";"TriggerBy"="John Doe"} -eventDateTime "2016-07-07T06:23:44"
param(
[parameter(Mandatory = $true)][string]$applicationId,
[parameter(Mandatory = $true)][string]$apiKey,
[parameter(Mandatory = $true)][string]$releaseName,
[parameter(Mandatory = $false)]$releaseProperties,
[parameter(Mandatory = $false)][DateTime]$eventDateTime
)
# background info on how fwlink works: After you submit a web request, many sites redirect through a series of intermediate pages before you finally land on the destination page.