Skip to content

Instantly share code, notes, and snippets.

View citelao's full-sized avatar
🐢
chillin'

Ben Stolovitz citelao

🐢
chillin'
View GitHub Profile
@manekinekko
manekinekko / binary-plist-parser.service.ts
Last active October 21, 2022 09:40
Apple's Binary Property List (bplist) parser in #JavaScript for the browser.
// const Buffer = require('buffer/').Buffer;
import { Injectable } from '@angular/core';
// Ported to browser from https://githuBuffer.com/joeferner/node-bplist-parser/blob/master/bplistParser.js
// Inspired by http://code.google.com/p/plist/source/browse/trunk/src/com/dd/plist/BinaryPropertyListParser.java
const bigInt = require('big-integer');
const Buffer = require('bops');
export const maxObjectSize = 100 * 1000 * 1000; // 100Meg
export const maxObjectCount = 32768;
@BenjaminArmstrong
BenjaminArmstrong / SaveVMBitmap.ps1
Last active May 3, 2024 17:33
Sample PowerShell script that shows you how to create a .BMP file of the display of a Hyper-V virtual machine.
$VMName = "VM 1"
$BMPName = "C:\Users\benja\Desktop\test.bmp"
Add-Type -AssemblyName "System.Drawing"
$VMCS = Get-WmiObject -Namespace root\virtualization\v2 -Class Msvm_ComputerSystem -Filter "ElementName='$($VMName)'"
# Get the resolution of the screen at the moment
$video = $VMCS.GetRelated("Msvm_VideoHead")
$xResolution = $video.CurrentHorizontalResolution[0]