Skip to content

Instantly share code, notes, and snippets.

@rubyman
rubyman / minio-upload.sh
Last active September 19, 2025 00:01
A shell script to upload a file to minio buckets - Original script: https://github.com/kneufeld/minio-put/
#!/bin/bash
# usage: ./minio-upload my-bucket my-file.zip minio-host.com access_key secret
bucket=$1
file=$2
minio_host=$3
access_key=$4
secret=$5
@huytd
huytd / d3-text-measure.js
Created May 6, 2016 18:19
Measure text size in pixels with D3.js
function textSize(text) {
if (!d3) return;
var container = d3.select('body').append('svg');
container.append('text').attr({ x: -99999, y: -99999 }).text(text);
var size = container.node().getBBox();
container.remove();
return { width: size.width, height: size.height };
}
// Usage: textSize("This is a very long text");