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
function Get-Version-Number ([String]$versionText) { | |
# matches 1.2 or 1.2.3 | |
$pattern = "(\d+)\.?(\d+)\.?((\d+)\.?)?" | |
$parts = [regex]::Matches($versionText, $pattern) | |
[hashtable]$version = @{} | |
if ($parts.Groups.Length -gt 0) { | |
$version.Major = [int]$parts.Groups[1].value | |
$version.Minor = [int]$parts.Groups[2].value | |
if ($parts.Groups.Length -gt 3) { |
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
# unix/bash (.sh) | |
export PATH="/path/to/fnm:$PATH" | |
eval "`fnm env`" | |
if [ -f ".nvmrc" ] | |
then | |
fnm use | |
else | |
if [ -f "../.nvmrc" ] | |
then | |
fnm use .. |
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
{ | |
"version": 2, | |
"configurePresets": [ | |
{ | |
"name": "base", | |
"hidden": true, | |
"binaryDir": "${sourceDir}/build", | |
"cacheVariables": { | |
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON", | |
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON" |
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
// Lazy multipurpose mirror handler for AWS Lambda@Edge or API Gateway | |
import { S3Client, HeadObjectCommand, PutObjectCommand } from '@aws-sdk/client-s3'; | |
import fetch from 'node-fetch'; | |
const s3 = new S3Client({ region: 'your-region' }); | |
const BUCKET = 'qt-mirror-cache'; | |
// Prefix -> upstream URL | |
const routeTable: Record<string, string> = { |