Skip to content

Instantly share code, notes, and snippets.

View josepsmartinez's full-sized avatar

José Pedro Silveira Martinez josepsmartinez

  • Porto Alegre, Brasil
View GitHub Profile
@mchelem
mchelem / gcp-bucket-display-images-bookmarklet.js
Last active February 14, 2022 04:34
Bookmarklet do display all images in a GCP bucket path
javascript:(function() {
let table = document.getElementsByTagName("table")[0];
let linkList = table.querySelectorAll("a.object-link");
let imageElements = [...linkList].map(url => {
let path = url.href.split("_details")[1];
let name = url.href.split("/").pop().split("?")[0];
return "<img height=200 src='https://storage.cloud.google.com" + path + "' title='" + name + "'/>";
});
imageElements = Array.from(new Set(imageElements));
table.insertAdjacentHTML("beforebegin", "<div>" + imageElements.join("") + "</div>");
@mamaj
mamaj / ssh-utils.py
Last active May 5, 2025 12:16
Python: simple class to perform commands and copy files (scp) on ssh using subprocess and native ssh client (OpenSSH).
import subprocess
import os
from pathlib import Path
from typing import Union
class SshClient():
""" Perform commands and copy files on ssh using subprocess
and native ssh client (OpenSSH).
"""