Skip to content

Instantly share code, notes, and snippets.

@mchelem
mchelem / control-video-speed-bookmarklet.js
Last active July 7, 2023 21:58
Bookmarklet to cycle through playback rates in HTML videos
javascript: (function() {
let maxSpeed = 2.0;
let stepSize = 0.25;
let videos = document.querySelectorAll('video');
for (video of videos) {
if (video.playbackRate >= maxSpeed) {
video.playbackRate = 1.0;
} else {
video.playbackRate = video.playbackRate + stepSize;
@mchelem
mchelem / gcp-bucket-display-image-pairs-in-file-bookmarklet.js
Created October 3, 2022 20:49
Bookmarklet to display image pairs listed in a file on the current GCP bucket path
javascript: (function() {
let filteredInputId = document.getElementById("filterInputId");
if (filteredInputId) {
filteredInputId.remove();
}
let table = document.getElementsByTagName("table")[0];
table.parentNode.insertAdjacentHTML("beforebegin", '<input id="filterInputId" type="file">');
let url = location.protocol + '//' + location.host + location.pathname;
@mchelem
mchelem / gmeets-toggle-audio.js
Last active April 20, 2022 18:17
Toggle audio for a google meets window
javascript: (function() {
let audios = document.getElementsByTagName('audio');
for (let audio of audios) {
audio.muted = !audio.muted;
}
})();
@mchelem
mchelem / gcp-bucket-display-images-in-file-bookmarklet.js
Last active October 3, 2022 20:49
Bookmarklet to display images listed in a file on the current GCP bucket path
javascript: (function() {
let filteredInputId = document.getElementById("filterInputId");
if (filteredInputId) {
filteredInputId.remove();
}
let table = document.getElementsByTagName("table")[0];
table.parentNode.insertAdjacentHTML("beforebegin", '<input id="filterInputId" type="file">');
let url = location.protocol + '//' + location.host + location.pathname;
@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>");
@mchelem
mchelem / empiric_analysis.ipynb
Last active February 6, 2023 12:53
Complexity of Algorithms: Empiric Analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mchelem
mchelem / fragments.ipynb
Created November 17, 2014 01:44
Comparação de matrizes de substituição para alinhamento de pequenos fragmentos de proteínas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mchelem
mchelem / transitive_reduction
Last active August 29, 2015 14:08
Transitive Reduction
{
"metadata": {
"name": "",
"signature": "sha256:dcc9c498f43dac3f108956486820ea5ab2b7a7990fbd15aeaeab10cffcc51f23"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [