Skip to content

Instantly share code, notes, and snippets.

View sheldonhull's full-sized avatar
👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this

sheldonhull sheldonhull

👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this
View GitHub Profile
@sheldonhull
sheldonhull / convert-markdown-to-asciidoc.sh
Created May 2, 2024 18:22
create asciidoc content via dockerized command
# grabbed from blog somewhere and couldn't find to link. minor modification to part to be in .artifacts
mkdir .artifacts || true
DOCS_VOL=$(docker volume create docs-vol)
DOCS_HELPER=$(docker create -v ${DOCS_VOL}:/documents alpine true)
docker cp $(pwd)/docs ${DOCS_HELPER}:/documents/docs
docker run --rm -v ${DOCS_VOL}:/documents ${KRAMDOC_DOCKER_IMAGE} find ./ -name "*.md" -type f -exec sh -c 'kramdoc {}' \;
docker cp ${DOCS_HELPER}:/documents/docs $(pwd)/.artifacts
docker rm ${DOCS_HELPER}
docker volume rm ${DOCS_VOL}
@sheldonhull
sheldonhull / main.go
Created April 29, 2024 21:22
dagger - using with mkdocs to build a container image that dynamically generates requirements.txt for optimized caching
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"dagger/myteam/internal/dagger"
@sheldonhull
sheldonhull / renovate-config-validator.sh
Last active March 29, 2024 17:23
renovate-config-validator helps improve renovate config check to only run on certain changed files since it's slow
#!/usr/bin/env bash
# If npm global install package renovate is not found then install `npm install --global renovate`
if ! command -v renovate-config-validator &>/dev/null; then
echo "renovate-config-validator could not be found, installing..."
npm install --global renovate
fi
# Define an array of JSON files to validate
json_files=(
@sheldonhull
sheldonhull / example-using-yq.ps1
Created March 20, 2024 22:07
example of azure devops cli + local automation using yq
$ErrorActionPreference = 'stop'
$OrgName = ''
$ProjectName = ''
$WorkItemID = 554287
$GitRepoDir = Join-Path $HOME 'git'
$FileToEdit = 'build/myyamlfile.yaml'
az devops login --organization https://dev.azure.com/$OrgName
# Review matching files
rg 'deployment:' --glob '**/build.yaml'
@sheldonhull
sheldonhull / .change.yaml
Last active November 17, 2023 13:22
example changie-config for multiple projects in continue.dev
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: ''
changeFormat: '- `{{.Kind}}`: {{.Body}}'
body:
block: true
@sheldonhull
sheldonhull / dynamic-command.md
Created September 21, 2023 18:47
dynamically creating shell command based on conditions

I'm having issues with a shell function that tries to change the command line args dynamically based on conditions.

In PowerShell this would be simple with: Invoke-Expression "& mods -s $(ModelString)" or several other ways. Another example:

$MyArgs = @(
  '-mods', 'claude'
 )
 $MyArgs += '--verbose'
@sheldonhull
sheldonhull / renovate-config-validator.md
Last active August 10, 2023 19:48
Renovate Config Validator via Trunk

Renovate Config Validator

If the default linting isn't matching the new files, you can run this manually with trunk.

This is an example of the trunk yaml modified to run explicitly against any json files.

lint:
  enabled:
    - taplo@0.7.0
@sheldonhull
sheldonhull / func-invokeGoreleaserViaDagger.go
Last active May 17, 2023 17:14
use goreleaser-cross with dagger
package main
import (
"context"
"os"
"path/filepath"
"runtime"
"dsv-engine/magefiles/constants"
@sheldonhull
sheldonhull / magefile.go
Last active April 20, 2023 17:51
optimze dagger go sdk build speed
package main
import (
"os"
"os/exec"
"path/filepath"
"github.com/pterm/pterm"
)
// Build contains the mage task for ... building stuff ... duh.
@sheldonhull
sheldonhull / support-aquaproj.ps1
Last active March 28, 2023 18:02
configure-profile-for-aquaproj-support
if ($PSVERSIONTABLE.PSVersion -lt [version]'7.3.0'){
Write-Error "Update PowerShell. Try choco upgrade powershell-core -y, winget, or scoop install"
return
}
Write-Host "Updating CurrentUserAllHosts to have the required environment variables to properly load binaries managed by Aqua" -ForegroundColor Green
$ENV:PATH = (Join-Path $(go env GOPATH) 'bin'), $ENV:PATH -join [IO.Path]::PathSeparator
$ENV:XDG_DATA_HOME="${HOME}/.local/share
[string]$RootLocation = ''