Skip to content

Instantly share code, notes, and snippets.

View asaf4747's full-sized avatar
🤠
Hiring

Asaf Yaffe asaf4747

🤠
Hiring
View GitHub Profile
javascript: (function() { var re = /^\+?(972|0)(\-)?0?([5]{1}\d)\-?(\d{7})$/; var val=prompt("Phone Number #","");var phone=val.replace(re,'972$3$4');location="https://wa.me/"+escape(phone);})()
@primaryobjects
primaryobjects / hotspot-keep-alive.ps1
Last active July 23, 2024 18:08
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