Fizzbuzz in PowerShell:
(1..100) | % {
if ($_ % 3 -eq 0 -and $_ % 5 -eq 0) {
"fizz-buzz"
} elseif ($_ % 3 -eq 0) {
"fizz"
} elseif ($_ % 5 -eq 0) {
"buzz"| (0..31) | ForEach-Object { "^$([char](64 + $_)) - $_" } |
| #Requires -Version 7 | |
| <# | |
| .SYNOPSIS | |
| Return list of classes declared within the specified assembly that have at | |
| least one public field. | |
| .DESCRIPTION | |
| Return list of classes within an assembly that have at least one field. | |
| The use case is discovering fields that really should be properties. | |
| echo "$(ip link show tap0 | grep --only-matching "master [^ ]*" | cut --delimiter ' ' --fields 2)" |
| // sudo apt install uuid-dev | |
| // g++ hack.cpp -luuid | |
| #include <iostream> | |
| #include <sstream> | |
| #include <math.h> | |
| #include <memory> | |
| #include <memory.h> | |
| #include <uuid/uuid.h> | |
| #include <unordered_map> |
| #include <iostream> | |
| #include <sstream> | |
| #include <math.h> | |
| #include <memory> | |
| #include <memory.h> | |
| using namespace std; | |
| struct shared_memory { | |
| shared_memory() { |
| Hello World |
| Hello World |
| $scriptPath = Join-Path (Get-Location) "TestEditDistance.sql"; | |
| $response = Invoke-WebRequest "https://raw.githubusercontent.com/GlobalNamesArchitecture/damerau-levenshtein/master/spec/files/damerau_levenshtein_test.txt" -UseBasicParsing; | |
| $lines = $response.Content.Split() | Where-Object { $_ -like "*|*|*|*" }; | |
| @" | |
| DECLARE @test_cases TABLE | |
| ( | |
| Word1 NVARCHAR(128), | |
| Word2 NVARCHAR(128), | |
| ExpectedEditDistance INT |
| Set-ExecutionPolicy Unrestricted; | |
| Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression; | |
| choco install vim | |
| choco update vim | |
| $command = (Get-itemProperty -LiteralPath "HKLM:\SOFTWARE\Classes\`*\shell\Vim\Command").'(default)'; | |
| if ($command -match "`"([^`"]+)`".*") { | |
| $expression = "Set-Alias -Name 'vim' -Value '$($Matches[1])';" |
Fizzbuzz in PowerShell:
(1..100) | % {
if ($_ % 3 -eq 0 -and $_ % 5 -eq 0) {
"fizz-buzz"
} elseif ($_ % 3 -eq 0) {
"fizz"
} elseif ($_ % 5 -eq 0) {
"buzz"