This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -version 2.0 | |
Add-Type @" | |
public class Shift { | |
public static int Right(int x, int count) { return x >> count; } | |
public static uint Right(uint x, int count) { return x >> count; } | |
public static long Right(long x, int count) { return x >> count; } | |
public static ulong Right(ulong x, int count) { return x >> count; } | |
public static int Left(int x, int count) { return x << count; } | |
public static uint Left(uint x, int count) { return x << count; } | |
public static long Left(long x, int count) { return x << count; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ms = new MemoryStream(secureEnvelopeBytes); | |
var xRdr = new XmlTextReader(ms); | |
var message = Message.CreateMessage(xRdr, int.MaxValue, MessageVersion.Soap12); | |
var securityHeader = message.Headers.FirstOrDefault(x => x.Name == "Security"); | |
if (securityHeader != null) | |
{ | |
var securityElement = XElement.Parse(securityHeader.ToString()); | |
var binarySecurityToken = securityElement.Descendants( | |
XName.Get("BinarySecurityToken", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd")).Single(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This is a BoxStarter script for paving BLU machines | |
#> | |
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
#Should we create domain users and groups? or assume their existence? | |
#Perhaps for now just assume their existence, but add the users to the local groups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using Microsoft.Win32.SafeHandles; | |
public static class CredentialManager | |
{ | |
public static Credential ReadCredential(string applicationName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<Header> | |
<Title>prop</Title> | |
<Author>Mark R. Johnson</Author> | |
<Shortcut>prop</Shortcut> | |
<Description>Code snippet for a property</Description> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
</Header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Docker commands taken from: https://inedo.com/support/kb/1100/getting-started-with-proget-for-linux#limitations | |
brew cask install docker | |
#Now, go and start start docker from finder | |
mkdir -pv /private/var/proget/db | |
mkdir -pv /private/var/proget/packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<header> | |
<script lang="javascript" > | |
var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); | |
var sineTerms = new Float32Array([0, 0, 1, 0, 1]); | |
var cosineTerms = new Float32Array(sineTerms.length); | |
var customWaveform = audioCtx.createPeriodicWave(cosineTerms, sineTerms); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$c = @" | |
using System; | |
using System.Runtime.InteropServices; | |
public static class SeqGuid { | |
private class NativeMethods | |
{ | |
[DllImport("rpcrt4.dll", SetLastError=true)] | |
public static extern int UuidCreateSequential(out Guid guid); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$c = @" | |
using System; | |
public class SequentialGuid { | |
Guid _CurrentGuid; | |
public Guid CurrentGuid { | |
get { | |
return _CurrentGuid; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!(Get-Command choco -erroraction SilentlyContinue)) { | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
} | |
choco install webpicmd -y | |
$webpicmd = 'webpicmd' | |
if(!(Get-Command $webpicmd -erroraction SilentlyContinue )) { | |
$webpicmd = 'C:\Program Files\Microsoft\Web Platform Installer\WebpiCmd.exe' |
OlderNewer