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
$ourContent = ls $PSScriptRoot\MyCode -r -fi *.scss | cat | |
$vars = $ourContent | % { | |
if($_ -match '^\s*\$([a-zA-Z_-]+)\s*:') { | |
$Matches[1] | |
} | |
} | select -Unique | |
$allContent = ls $PSScriptRoot -r -fi *.scss | cat | |
$vars | ? { | |
$search = "\`$$_[^:]*$" |
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
param([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$RootFile, [int][parameter(mandatory)]$Depth, [string][parameter(mandatory)]$IncludePath, [switch]$RenderDotFormat, [switch]$DoNotRecurse) | |
function RenderImports([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$RootFile, [int][parameter(mandatory)]$Depth, [string][parameter(mandatory)]$IncludePath, [switch]$RenderDotFormat, [switch]$DoNotRecurse) | |
{ | |
$ErrorActionPreference = 'Stop' | |
function GetRelativePath([string][parameter(mandatory)]$ParentFile, [string][parameter(mandatory)]$RootFile) | |
{ | |
pushd (Split-Path -Parent $ParentFile) | |
try { |
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
$vhd = ls *.vhd | select -ExpandProperty Name | |
if(!$vhd -or $vhd.GetType().FullName -ne 'System.String') { | |
throw "Expected to find the VHD in the current directory." | |
} | |
$vmName = [System.IO.Path]::GetFileNameWithoutExtension($vhd) | |
Write-Host "Creating VM called $vmName..." | |
$newVm = New-VM -Name $vmName -MemoryStartupBytes 1024MB -SwitchName External -VHDPath (Resolve-Path $vhd) -Path . -Generation 1 -BootDevice IDE | |
$newVm | Set-VMProcessor -Count 2 |
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
(New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) |
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 RDotNet; | |
/* | |
d:/temp/plot.r: | |
suppressPackageStartupMessages(library(ggplot2)) | |
library(ggplot2) | |
p <- qplot(Sepal.Length, Petal.Length, data = iris, color = Species) | |
png(filename=fileName, width=500, height=500) |
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
iislog <- read.delim("Filtered.log", header=TRUE, sep=" ") | |
iislog <- within(v, { localdatetime=as.POSIXct(paste(date, time)) + 13*60*60 }) | |
h <- hist( | |
iislog$localdatetime, | |
freq = TRUE, | |
breaks=24, | |
xlab = "Time of day", | |
ylab = "Requests per hour", | |
axes = F, |
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 -modules sqlps | |
#requires -version 3 | |
param([string]$ServerToQuery = ([Environment]::MachineName), [PSCredential]$SqlCredential) | |
$ErrorActionPreference = 'Stop' | |
pushd | |
ipmo sqlps -DisableNameChecking | |
popd |
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
function Add-TabExpansion | |
{ | |
param([ScriptBlock][parameter(mandatory)]$ScriptBlock) | |
$originalFunction = (gcm TabExpansion2).ScriptBlock | |
$chainedBlock = { | |
$userResult = & $ScriptBlock @Args | |
if($userResult) { | |
return $userResult | |
} |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,5d,e0,5c,e0,37,00,46,00,\ | |
00,00,00,00 |
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
$ErrorActionPreference = 'Stop' | |
$filesToIgnore = git status | ? { $_.StartsWith("`t") } | % { $_.SubString(1) } | ? { !$_.StartsWith("deleted:") } | |
$filesToIgnore | % { | |
$fileName = [IO.Path]::GetFileName($_) | |
$directory = [IO.Path]::GetDirectoryName($_) | |
if($fileName.length -eq 0) { | |
#The path is actually a directory | |
$fileName = [IO.Path]::GetFileName($directory) + "/" | |
$directory = [IO.Path]::GetDirectoryName($directory) |
OlderNewer