View IisExpressJob.ps1
$jobName = 'IisExpressJob' | |
function Start-IisExpress($pathToSource) { | |
Start-Job -Name $jobName -Arg $pathToSource -ScriptBlock { | |
param ($pathToSource) | |
& 'C:\Program Files (x86)\IIS Express\iisexpress.exe' /port:1234 /path:$pathToSource | |
} | |
} | |
function Stop-IisExpress { |
View Open-MruSolution.ps1
function Open-MruSolution($sln) { | |
$mruItems = "HKCU:\Software\Microsoft\VisualStudio\14.0\MRUItems" | |
$guids = Get-ChildItem $mruitems | | |
Select-Object -ExpandProperty name | | |
Foreach-Object { $_.Substring($_.LastIndexOf('\') + 1) } | |
[array]$mostRecentlyUsedSlns = $guids | | |
Foreach-Object { | |
$guid = $_ | |
Get-ChildItem "$mruItems\$guid" | |
View Playground.swift
class IndexOp { | |
let index: Int | |
let key: String | |
init(_ index: Int) { | |
self.index = index | |
self.key = "" | |
} | |
init(_ key: String) { |
View Get-FrameworkVersions.ps1
<# | |
.Synopsis | |
Returns the install .NET Framework versions. | |
.Description | |
The script looks through the registry using the notes from the below | |
MSDN links to determine which versions of .NET are installed. |
View example.swift
// Playground - noun: a place where people can play | |
import SWXMLHash | |
import UIKit | |
let xmlWithNamespace = "<root xmlns:h=\"http://www.w3.org/TR/html4/\"" + | |
" xmlns:f=\"http://www.w3schools.com/furniture\">" + | |
" <h:table>" + | |
" <h:tr>" + | |
" <h:td>Apples</h:td>" + |
View private.xml
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>PARALLELS</appname> | |
<equal>com.parallels.desktop.console</equal> | |
</appdef> | |
<devicevendordef> | |
<vendorname>MICROSOFT</vendorname> | |
<vendorid>0x045e</vendorid> |
View attribute-parse.swift
var data = "<Conversations>" + | |
"<Conversation id=\"ConvTest1\">" + | |
"<StartingStatementId>1</StartingStatementId>" + | |
"<Description>Some description 1</Description>" + | |
"</Conversation>" + | |
"<Conversation id=\"ConvTest2\">" + | |
"<StartingStatementId>2</StartingStatementId>" + | |
"<Description>Some description 2</Description>" + | |
"</Conversation>" + | |
"</Conversations>" |
View Get-DevLinkAgenda.ps1
# NOTE: Only worked for DevLink 2013 | |
$agenda = Invoke-RestMethod http://www.devlink.net/agenda.json | |
$speakers = Invoke-RestMethod http://www.devlink.net/speakers.json | |
$location = Invoke-RestMethod http://www.devlink.net/api/info/locations.json | |
$fullAgenda = $agenda | foreach { | |
# normalize the times to be datetime types | |
$startTime = ([DateTimeOffset]::Parse($_.start_time)).DateTime | |
$endTime = ([DateTimeOffset]::Parse($_.end_time)).DateTime |
View Get-ConsoleColors.ps1
[Enum]::GetNames([System.ConsoleColor]) | | |
foreach { | |
$foregroundColor = $_ | |
$backgroundColor = 'Black' | |
if ($_ -eq 'Black') { | |
$backgroundColor = 'White' | |
} | |
Write-Host -foregroundcolor $foregroundColor -backgroundColor $backgroundColor $foregroundColor |
View gist:114244
[TestFixture] | |
public class BlogTests : InMemoryDatabaseTest | |
{ | |
public BlogTests() : base(typeof(Blog).Assembly) | |
{ | |
} | |
[Test] | |
public void Can_save_and_load_blog() | |
{ |