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
// playing with Xcode, Constraints and Playground | |
import UIKit | |
import XCPlayground | |
let hostView = UIView() | |
hostView.frame = CGRectMake(0, 0, 400, 200) | |
hostView.backgroundColor = UIColor.lightGrayColor() | |
XCPlaygroundPage.currentPage.liveView = hostView |
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 url = window.location.href; | |
var searchTextToIgnore = prompt('Enter text to ignore:'); | |
if (url.match(/bitbucket/)) { | |
$('h1:contains(' + searchTextToIgnore + ')').closest('section').hide(); | |
} else if (url.match(/gitlab/)) { | |
$('.diff-header span:contains(' + searchTextToIgnore + ')').parent().parent().hide(); | |
} else { | |
alert(url + " doesn't match any known sites."); | |
} |
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
# relies on portqry (see http://www.microsoft.com/en-us/download/details.aspx?id=24009) | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$server, | |
[int] | |
$rdpPort = 3389 | |
) |
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
$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 { |
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 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" | |
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
class IndexOp { | |
let index: Int | |
let key: String | |
init(_ index: Int) { | |
self.index = index | |
self.key = "" | |
} | |
init(_ key: String) { |
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 | |
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. |
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
// 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>" + |
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
<?xml version="1.0"?> | |
<root> | |
<appdef> | |
<appname>PARALLELS</appname> | |
<equal>com.parallels.desktop.console</equal> | |
</appdef> | |
<devicevendordef> | |
<vendorname>MICROSOFT</vendorname> | |
<vendorid>0x045e</vendorid> |
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 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>" |