Skip to content

Instantly share code, notes, and snippets.

View Kreyu's full-sized avatar
🐹

Sebastian Wróblewski Kreyu

🐹
View GitHub Profile
@Kreyu
Kreyu / password-regex.md
Last active January 18, 2021 08:09
Password regular expression
  • at least 8 characters (without upper limit)
  • at least one uppercase letter
  • at least one lowercase letter
  • at least one special character or number
  • emojis, line breaks, tabs and spaces not allowed
^(?=.*[a-z])(?=.*[A-Z])(?=.*[\x21-\x7E][^a-zA-Z])[\x21-\x7E]{8,}$
@Kreyu
Kreyu / disable-vms.ps1
Last active July 6, 2021 10:34
PowerShell script to disable all Hyper-V services
param([switch]$Elevated)
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false) {
if ($elevated) {
# tried to elevate, did not work, aborting
@Kreyu
Kreyu / enable-vms.ps1
Created June 24, 2021 18:16
PowerShell script to enable Hyper-V (requires reboot anyway)
param([switch]$Elevated)
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false) {
if ($elevated) {
# tried to elevate, did not work, aborting
@Kreyu
Kreyu / README.md
Last active March 28, 2024 11:58
Symfony UX Autocomplete - force fetching the data from remote by TomSelect each time user opens the dropdown