Skip to content

Instantly share code, notes, and snippets.

@mikepugh
mikepugh / Invoke-KMSEncrypt-Example.ps1
Created April 14, 2016 14:34 — forked from Sam-Martin/Invoke-KMSEncrypt-Example.ps1
PowerShell Example for using Invoke-KMSEncrypt and Invoke-KMSDecrypt
# Stolen from http://ctrlf5.net/?p=263 and http://www.dailycoding.com/posts/convert_image_to_base64_string_and_base64_string_to_image.aspx
function ConvertFrom-StringToMemoryStream{
param(
[parameter(Mandatory)]
[string]$InputString
)
$stream = New-Object System.IO.MemoryStream;
$writer = New-Object System.IO.StreamWriter($stream);
$writer.Write($InputString);
//
// Example showing how to use TFS with grunt.
// Plays well with grunt-contrib-compass and other tasks that spawn processes.
// This example only shows tf checkout, but you could reuse this pattern to add more tf commands.
//
// Gist by https://github.com/localnerve, http://www.localnerve.com
//
var path = require("path");
module.exports = function(grunt) {
@mikepugh
mikepugh / FirebaseStateSecurityManager
Last active December 16, 2016 12:09
StateSecurityManager - ui-router version of the RouteSecurityManager from angularFire-seed
/*
MIT License
ui-router Port of Firebase Simple Login RouteSecurityManager from
https://github.com/firebase/angularFire-seed/blob/master/app/js/module.routeSecurity.js
For any state that requires security, setup a custom data authRequired flag:
.state('profile', {
url: '/acct/profile',
templateUrl: 'views/account/profile.html',
@mikepugh
mikepugh / TfvcTemplate.12.WithChaining.xaml
Last active August 29, 2015 13:57 — forked from jstangroome/TfvcTemplate.12.WithChaining.xaml
Modify the chained build template to only execute the chained builds if unit tests passed.
<Activity x:Class="TfsBuild.Process" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mt="clr-namespace:Microsoft.TeamFoundation;assembly=Microsoft.TeamFoundation.Common" xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client" xmlns:mtbco="clr-namespace:Microsoft.TeamFoundation.Build.Common;assembly=Microsoft.TeamFoundation.Build.Common" xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtba="clr-namespace:Microsoft.TeamFoundation.Build.Activities;assembly=Microsoft.TeamFoundation.Build.Activities" xmlns:mtbac="clr-namespace:Microsoft.TeamFoundation.Build.Activities.Core;assembly=Microsoft.TeamFoundation.Build.Activities" xmlns:mtbag="clr-namespace:Microsoft.TeamFound