Skip to content

Instantly share code, notes, and snippets.

$MethodDefinition = @'
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern int GetShellWindow();
'@
$User32 = Add-Type -MemberDefinition $MethodDefinition -Name 'User32' -Namespace 'User32' -PassThru
$ShellWindowHandle = $User32::GetShellWindow()
& cmd.exe /c Mystify.scr /p $ShellWindowHandle
@grahamdyson
grahamdyson / .gitignore
Last active October 30, 2019 07:35
Desk 2D design in LibreCad. Shallow depth so it takes up less space. Low stack height between fixed shelf and sliding keyboard tray.
*.dxf~
; MouseKeys alternative
;
; Uses number pad when not locked
;
; left button
; 5
;
; toggle hold left button (e.g. multi-select, drag)
; /
;
@grahamdyson
grahamdyson / zip.js
Last active June 11, 2019 07:39
Zip All with ES6 destructuring, generators, iterators, spread
function * zipAll(
iterables,
) {
const iterators = iterables.map(iterable => iterable[Symbol.iterator]());
let { allDone, values } = iterateAll(iterators);
while (!allDone) {
yield values;
({ allDone, values } = iterateAll(iterators));