Skip to content

Instantly share code, notes, and snippets.

View robherley's full-sized avatar
curl tiny.coffee

Rob Herley robherley

curl tiny.coffee
View GitHub Profile
@robherley
robherley / README.md
Created November 12, 2025 14:50
Slice Allocs
slice[cap=0]: allocs: 0, 0 bytes
  adding 10000 elements cost: allocs: 20, 357648 bytes
slice[cap=5000]: allocs: 1, 40960 bytes
  adding 10000 elements cost: allocs: 4, 229392 bytes
slice[cap=10000]: allocs: 1, 81920 bytes
  adding 10000 elements cost: allocs: 0, 0 bytes

Adding 10,000 elements to a slice with an initial capacity of 0 will become 357648 bytes. Of which ~88% (~19 other slice allocations) would be unused slices that would need to be GC'd.

@robherley
robherley / events.md
Created October 15, 2025 01:20
GitHub Actions Events

GitHub Actions Events by SHA and Ref

  • Default branch events: branch_protection_rule, check_run, check_suite, delete, discussion, discussion_comment, fork, gollum, issue_comment, issues, label, milestone, page_build, public, repository_dispatch, schedule, status, watch, workflow_run
  • Non-default branch events: create, deployment, deployment_status, merge_group, pull_request, pull_request_review, pull_request_review_comment, pull_request_target, push, registry_package, release, workflow_call, workflow_dispatch
Name GITHUB_SHA GITHUB_REF Default Branch Event?
branch_protection_rule Last commit on default branch Default branch
check_run Last commit on default bran
@robherley
robherley / README.md
Last active September 28, 2023 19:12
Go Azure Blob SDK Repro

Context

When trying to call Blob Batch Delete API via Azure Go SDK, any requests to blob paths with / don't correctly form the Authorization header that the server is expecting.

Output

2023/09/28 15:10:12 uploading "file1.txt" with content "This can be deleted"
2023/09/28 15:10:12 uploading "foo/bar/file2.txt" with content "This can't be deleted"
2023/09/28 15:10:12 ℹ️  deleting "file1.txt"
@robherley
robherley / README.md
Last active September 28, 2023 17:59
Azurite Repro

Context

I'm using Azurite for some integration tests, and I noticed some odd behavior with the Blob Batch API when using a hostname instead of an IP address.

Related to:

The subrequests will fail when calling delete with a hostname with ResourceNotFound because it's incorrectly calculating the account and container names.

For example, for the request:

@robherley
robherley / zips.go
Created May 1, 2023 13:14
Streaming combine zips
package main
import (
"archive/zip"
"io"
"net/http"
"path/filepath"
)
func downloadZips(w io.Writer) error {
@robherley
robherley / README.md
Created April 25, 2023 21:04
Efficiently reading files from big zips from Azure Blob

Efficiently reading files from big zips from Azure Blob

Run go run main.go to test:

2023/04/25 17:02:26.660597 blob size is 10592348960 bytes, which is ~ 10101 MB
2023/04/25 17:02:26.660668 reading 1024 bytes from azblob from offset 10592347936
2023/04/25 17:02:26.680128 reading 20 bytes from azblob from offset 10592348918
2023/04/25 17:02:26.695184 reading 56 bytes from azblob from offset 10592348862
2023/04/25 17:02:26.710803 reading 4096 bytes from azblob from offset 10592340479
@robherley
robherley / fish.md
Created January 19, 2023 16:23
🐟

:fishsticks:

# set manual
ipmitool -I lanplus -H 10.0.0.99 -U root -P '<pass>' raw 0x30 0x30 0x01 0x00
# 15%
ipmitool -I lanplus -H 10.0.0.99 -U root -P '<pass>' raw 0x30 0x30 0x02 0xff 0x0f
This file has been truncated, but you can view the full file.
A:01 F:B0 B:00 C:13 D:00 E:D8 H:01 L:4D SP:FFFE PC:0100 PCMEM:00,C3,13,02
A:01 F:B0 B:00 C:13 D:00 E:D8 H:01 L:4D SP:FFFE PC:0101 PCMEM:C3,13,02,CE
A:01 F:B0 B:00 C:13 D:00 E:D8 H:01 L:4D SP:FFFE PC:0213 PCMEM:21,00,40,C3
A:01 F:B0 B:00 C:13 D:00 E:D8 H:40 L:00 SP:FFFE PC:0216 PCMEM:C3,00,02,00
A:01 F:B0 B:00 C:13 D:00 E:D8 H:40 L:00 SP:FFFE PC:0200 PCMEM:47,11,00,C0
A:01 F:B0 B:01 C:13 D:00 E:D8 H:40 L:00 SP:FFFE PC:0201 PCMEM:11,00,C0,0E
A:01 F:B0 B:01 C:13 D:C0 E:00 H:40 L:00 SP:FFFE PC:0204 PCMEM:0E,10,2A,12
A:01 F:B0 B:01 C:10 D:C0 E:00 H:40 L:00 SP:FFFE PC:0206 PCMEM:2A,12,1C,20
A:C3 F:B0 B:01 C:10 D:C0 E:00 H:40 L:01 SP:FFFE PC:0207 PCMEM:12,1C,20,FB
A:C3 F:B0 B:01 C:10 D:C0 E:00 H:40 L:01 SP:FFFE PC:0208 PCMEM:1C,20,FB,14