Skip to content

Instantly share code, notes, and snippets.

View eduardomozart's full-sized avatar
💭
I may be slow to respond.

Eduardo Mozart de Oliveira eduardomozart

💭
I may be slow to respond.
View GitHub Profile
@eduardomozart
eduardomozart / ruffle-exporter
Last active August 5, 2022 13:12
Ruffle Exporter - Create thumbnail from SWF files
#!/bin/bash
# Ruffle-Exporter ver. 0.0.2
# Requires ''ruffle'', ''imagemagick'', ''zenity''
REDEBUG_LOG="/tmp/ruffle-export.dbg"
#REDEBUG_LOG="/dev/null"
#F1=$HOME/.thumbnails
#F2=$HOME/.cache/thumbnails
#SAVE_FOLDER=$F1
@eduardomozart
eduardomozart / esxi-autofill-credentials
Last active December 28, 2024 22:13
Autofill ESXi UI fields using Tampermonkey script
// ==UserScript==
// @name ESXi autofill credentials
// @namespace https://10.200.200.*/ui/*
// @version 0.1
// @description Autofills user and password inputs
// @author Eduardo Mozat de Oliveira
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @include /^https?:\/\/(\d+\.){3}\d+\/ui\/.*/
// @grant none
@eduardomozart
eduardomozart / model.js
Last active January 13, 2025 12:11
Grabber Sankaku
function buildSearch(search) {
// Replace "ratio:4:3" meta by "4:3_aspect_ratio" tag
search = search.replace(/(^| )ratio:(\d+:\d+)($| )/g, "$1$2_aspect_ratio$3");
return search;
}
function buildImageFromJson(img) {
img.created_at = img.created_at["s"];
img.score = img.total_score;
img.author = img.author.name;
return completeImage(img, true);
// This is just a regex I found on the internet that allows you to detect emojis
const emojisRegex = /(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g;
// Add the styling required to fix emojis
const css = document.createElement('style');
css.innerHTML = `.fixed-emoji { font-family: emoji; }`;
document.head.appendChild(css);
// https://byshynet.com/fixing-black-and-white-emojis-using-javascript/
function fixEmojis(selector) {