cmd.exe
cd /d %PUBLIC%
rmdir /S /Q my-ucrt 1>nul 2>nul
mkdir my-ucrt
cd my-ucrt
curl -o ucrt.zip -L https://www.nuget.org/api/v2/package/Microsoft.Windows.SDK.CRTSource/10.0.22621.3
tar xf ucrt.zip
del *.nuspec *.zip *.xml
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
| #include <vector> // std::vector | |
| #include <stdarg.h> // va_list, va_start, va_end, va_copy | |
| size_t getVsprintfByteLength(const char *fmt, va_list vlist) { | |
| va_list tmpVlist; | |
| va_copy(tmpVlist, vlist); | |
| size_t const byteLength = vsnprintf(nullptr, 0, fmt, tmpVlist); | |
| va_end(tmpVlist); | |
| return byteLength; | |
| } |
Separate each color component, save them as a PNG32 (R8G8B8A8).
magick input.png -channel R -separate PNG32:component_r.png
magick input.png -channel G -separate PNG32:component_g.png
magick input.png -channel B -separate PNG32:component_b.png
magick input.png -channel A -separate PNG32:component_a.png
Reconstruct a image from separated components, save it as a PNG32.
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
| // struct_pack : https://alibaba.github.io/yalantinglibs/en/struct_pack/struct_pack_intro.html | |
| #include <iostream> | |
| #include <sstream> | |
| #include <vector> | |
| #include <map> | |
| #include <ylt/struct_pack.hpp> | |
| struct person | |
| { | |
| int64_t id; |
pwsh.exe
cd ~/../Public
mkdir TestCaddy
cd TestCaddy
curl.exe -JOL https://github.com/caddyserver/caddy/releases/download/v2.8.4/caddy_2.8.4_windows_amd64.zip
tar.exe -xf caddy_2.8.4_windows_amd64.zip
mkdir public_html
echo HELLO > public_html\index.html
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
| // Should I use URLDownloadToFile? | |
| // Answered by Mike Caron : https://stackoverflow.com/a/5185008 | |
| #define _CRT_SECURE_NO_WARNINGS | |
| #define WIN32_LEAN_AND_MEAN | |
| #include <windows.h> | |
| #include <Urlmon.h> | |
| #include <string> | |
| #include <functional> | |
| #pragma comment(lib, "User32.lib") |
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
| @rem Download and build script for NetHack for Windows x64 Desktop, VC++2022 | |
| @echo off | |
| setlocal EnableDelayedExpansion | |
| set /a errorno=1 | |
| for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "esc=%%E" | |
| set "ROOT=%CD%" | |
| : | |
| : Check prerequisites | |
| : |
NewerOlder