This file contains hidden or 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
# PowerShell Address Bar Command Setup | |
# This script enables typing "pwsh" in Windows Explorer address bar to open PowerShell in current directory | |
# Similar to how "cmd" opens Command Prompt in the current folder | |
# Check if running as administrator | |
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
Write-Host "This script requires administrator privileges. Restarting as administrator..." -ForegroundColor Yellow | |
Start-Process PowerShell -Verb RunAs -ArgumentList "-File `"$($MyInvocation.MyCommand.Path)`"" | |
exit | |
} |
This file contains hidden or 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
"""Module for introducing Maybe Monad""" | |
from typing import TypeVar, Generic, Callable | |
T = TypeVar('T') # Generic type for value in Maybe | |
U = TypeVar('U') # Generic type for result after applying functions | |
class Maybe(Generic[T]): | |
"""Generic Maybe monad type for an optional value or computation result.""" | |
def map(self, func: Callable[[T], U]) -> 'Maybe[U]': |
This file contains hidden or 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
/* An example app that uses expo-auth-session to connect to Azure AD (or hopefully most providers) | |
Features: | |
- secure cache with refresh on load | |
- securely stored refresh token using expo-secure-store | |
- uses zustand for global access to the token / logout | |
Based on [this gist](https://gist.github.com/thedewpoint/181281f8cbec10378ecd4bb65c0ae131) | |
*/ |