You're a mean but entertaining Programmer making code reviews.
Please review this code:
dnsServerIP := "8.8.8.8"
# Change key to your key or run age-keygen | |
$key = "age1x9papwe3rsptzkfvet95yk0e5gaf4nk99yq6wr9azydk9c0lay4q76yzwg"; $content = Read-Host -MaskInput; $temp = New-TemporaryFile; Set-Content -Value $content -Path $temp; age -e -a -r $key $temp; Remove-Item $temp |
<Configuration> | |
<LogonCommand> | |
<Command>powershell -executionpolicy unrestricted -command "start powershell {-NoExit -NoLogo -NoProfile}"</Command> | |
</LogonCommand> | |
</Configuration> |
// See https://aka.ms/new-console-template for more information | |
Console.WriteLine("Hello, World!"); | |
var apples = new List<Apple>(){ | |
new Apple(){Color = "Red", Weight = 100}, | |
new Apple(){Color = "Green", Weight = 200}, | |
new Apple(){Color = "Yellow", Weight = 300}, | |
new Apple(){Color = "Red", Weight= 400}, | |
new Apple(){Color = "Blue", Weight = 500}, | |
}; |
Here's a minimal DNS client in Go that only supports A-records and avoids using the built-in resolver. It uses UDP to communicate with a DNS server to query A-records and outputs the results.
package main
import (
"encoding/binary"
"fmt"
"net"
"os"
<# | |
Documentation | |
https://platform.openai.com/docs/api-reference/audio/create#audio/create-prompt | |
Better results if you set prompt or/and language | |
$body = @{ file = Get-Item $filePath; model = "whisper-1"; prompt = "Dies ist eine Kindergeschichte."; language = "de" } | |
#> | |
$filePath = "C:\temp\video.mp4" # can be mp3, mp4, mpeg, mpga, m4a, wav, or webm. But max 25 MB | |
$TOKEN = "" # Create one here https://platform.openai.com/account/api-keys |
# 1. Download https://github.com/FiloSottile/age/releases/download/v1.1.1/age-v1.1.1-windows-amd64.zip | |
# 2. Extract content to folder | |
# 3. Move to folder (e.g. cd c:\temp) | |
# 4. Execute Script | |
.\age-keygen.exe -o secret_key.txt | |
$pubkey = .\age-keygen.exe -y .\secret_key.txt | |
Set-Content .\mein_geheimis.txt -Value "Hallo Welt!" | |
Get-Content .\mein_geheimis.txt | |
.\age -e -r $pubkey -o .\mein_geheimis.txt.age .\mein_geheimis.txt |
<# | |
.Description | |
Convert images to jpg using ImageMagick | |
Need to download https://imagemagick.org/archive/binaries/ImageMagick-7.1.0-57-portable-Q16-x64.zip and extract archive to a folder, | |
$PathToImageMagick should point to the magick.exe file | |
.Example | |
convert.ps1 -PathToImageMagick 'C:\Local\Downloads\magick\magick.exe' -SourceFolder 'C:\temp\source' -TargetFolder 'C:\temp\target' | |
#> |
icacls <foldername> /grant administrators:F /T | |
takeown /f <foldername> /r /d y |