WinRT | Conversion | JavaScript |
---|---|---|
Struct | JavaScript object with matching property names | |
Class or interface instance | ➡ | JavaScript object with matching property names |
Windows.Foundation.Collections.IPropertySet | ➡ | JavaScript object with arbitrary property names |
Any | ⃠ | DOM object |
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
copy function:prompt function:poshPrompt; | |
function prompt { | |
try { | |
poshPrompt; | |
} catch { | |
Write-Host ("POSH Prompt Error: " + $_); | |
} | |
try { | |
$lastCommandFailed = ($LastExitCode -ne $null -and $LastExitCode -ne 0) -or !$?; |
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" encoding="utf-8" ?> | |
<!-- Based on the format.ps1xml file from Terminal-Icons | |
https://github.com/devblackops/Terminal-Icons/blob/main/Terminal-Icons/Terminal-Icons.format.ps1xml --> | |
<Configuration> | |
<SelectionSets> | |
<SelectionSet> | |
<Name>FileSystemTypes</Name> | |
<Types> | |
<TypeName>System.IO.DirectoryInfo</TypeName> |
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 logCall(context, fn) { | |
const args = Array.prototype.slice.call(arguments, 3); | |
try { | |
const r = fn.call(arguments[2], ...args); | |
console.log(context, "(", ...args, ")", "-->", r); | |
return r; | |
} catch (e) { | |
console.log(context, "(", ...args, ")", "--excpetion-->", e); | |
throw e; | |
} |
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 ValueBreakpoint(parent, fullNamePath) { | |
var name = fullNamePath[0]; | |
var childNamePath = fullNamePath.slice(1); | |
var innerValue = parent[name]; | |
var childBreakpoints = []; | |
function applyChildValueBreakpoints() { | |
if (childNamePath.length > 0 && innerValue) { | |
childBreakpoints.push(new ValueBreakpoint(innerValue, childNamePath)); | |
} |
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
This code won't run - just trying to get the idea across of how we might replace registerProtocolHandler, but only if register and registee both agree to use the replacement. | |
Page that wants to register: | |
<iframe class="hidden" src="http://you.github.io/registerProtocolHandler/" id="registerProtocolHandler"></iframe> | |
<script> | |
document.getElementById("registerProtocolHandler").contentWindow.postMessage({ | |
operation: "setRegistration", | |
scheme: "web+action", | |
handler: "http://me.com/?url=%s" |
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
syntax on | |
color evening | |
set ts=4 | |
set sw=4 | |
set expandtab | |
set ai | |
set nohls | |
set incsearch |
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
alert(1); |