Skip to content

Instantly share code, notes, and snippets.

View brlinton's full-sized avatar

Brandon brlinton

View GitHub Profile
@brlinton
brlinton / List-AzureResources.ps1
Created August 29, 2016 16:45
Print out all of the resources in a subscription (starting with SQL databases)
Login-AzureRmAccount
$OutFilePath = "D:\sql-databases.csv"
ForEach ($resourceGroup in Get-AzureRmResourceGroup)
{
ForEach ($sqlServer in Get-AzureRMSqlServer -ResourceGroupName $resourceGroup.ResourceGroupName)
{
ForEach($sqlDatabase in Get-AzureRMSqlDatabase -ServerName $sqlServer.ServerName -ResourceGroupName $resourceGroup.ResourceGroupName)
pageViews
| where timestamp >= ago(7d)
| summarize(count(client_Browser)) by client_Browser
| render piechart
@brlinton
brlinton / App Insights Server Errors.cs
Created July 23, 2016 19:26
Application Insights Server Side Error Query
// Top 25 Server Exceptions
exceptions
| where timestamp >= ago(4h) and client_Type == "PC"
| summarize count(problemId) by problemId, client_Type, method
| order by count_problemId
| take 25
@brlinton
brlinton / App Insights Availability Query.cs
Last active July 8, 2019 18:38
Application Insights Analytics Query for Availability Percentage by Test Name
availabilityResults
| where timestamp >= ago(30d)
| summarize AvailabilityPercentage=(sum(todouble(success)) / count(success)) * 100, Failures=count(success)-sum(todouble(success)), TotalTests=count(success) by TestName=name
| order by Failures asc
@brlinton
brlinton / download-nuget-licenses.ps1
Last active September 17, 2015 02:50 — forked from haacked/download-nuget-licenses.ps1
A PowerShell script to download your NuGet package licenses as first seen in http://haacked.com/archive/2015/03/28/download-nuget-package-licenses/
@( Get-Project -All |
? { $_.ProjectName } |
% { Get-Package -ProjectName $_.ProjectName } ) |
Sort -Unique |
% { $pkg = $_ ; Try { (New-Object System.Net.WebClient).DownloadFile($pkg.LicenseUrl, 'c:\dev\licenses\' + $pkg.Id + ".txt") } Catch [system.exception] { Write-Host "Could not download license for $pkg" } }
@brlinton
brlinton / enable-iis-tools.ps1
Last active June 28, 2021 13:18
Enable IIS tools form the command line
# Remove the /all if you receive any errors
& dism /online /get-features | more
& dism /online /enable-feature /FeatureName:IIS-CertProvider /all
& dism /online /enable-feature /FeatureName:IIS-WindowsAuthentication /all
& dism /online /enable-feature /FeatureName:IIS-ClientCertificateMappingAuthentication /all
& dism /online /enable-feature /FeatureName:IIS-StaticContent /all
& dism /online /enable-feature /FeatureName:IIS-DefaultDocument /all
& dism /online /enable-feature /FeatureName:IIS-WebSockets /all
@brlinton
brlinton / FirstXCodeUnitTests.m
Last active January 4, 2016 13:59
The default XCode unit test scaffolding
//
// TipCalculatorTests.m
// TipCalculatorTests
//
// Created by Brandon Linton on 1/25/14.
// Copyright (c) 2014 Brandon. All rights reserved.
//
#import <XCTest/XCTest.h>
@brlinton
brlinton / LogLevelStatsIL.cs
Created March 4, 2013 01:48
An early version of a LogLevelStats class from WoodChipper, but with IL weaving from Fody and Fody.PropertyChanged
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Threading;
namespace WoodChipper.Models
{
public class LogLevelStats : INotifyPropertyChanged
{
public virtual int DebugLines
@brlinton
brlinton / gist:4459723
Created January 5, 2013 04:16
jQuery Brogramming
<html>
<head>
</head>
<body>
<a href="#">Click me, bro</a>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('a').click(function(){
@brlinton
brlinton / _Layout.html
Created February 5, 2012 04:09
A version of the basic MVC3 project layout using Bootstrap from Twitter
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/css/bootstrap.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/css/bootstrap-responsive.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/bootstrap.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>