Skip to content

Instantly share code, notes, and snippets.

@primaryobjects
primaryobjects / hotspot-keep-alive.ps1
Last active May 26, 2024 21:45
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
# https://superuser.com/a/1434648
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
$asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
$netTask = $asTask.Invoke($null, @($WinRtTask))
$netTask.Wait(-1) | Out-Null
$netTask.Result
@MicahStevens
MicahStevens / webcam.html
Created October 31, 2014 19:54
An html file setup to control a Foscam HD camera. Read more here:
<!DOCTYPE html>
<html>
<head>
<title>Webcam</title>
<style type="text/css">
body {
text-align:center;
background-color:#000000;
color: #fff;
}