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
<html lang="en" data-glpi-theme="clockworkorange" data-glpi-theme-dark="0" data-glpi-request-id="a740e65b67ab8944"><script id="allow-copy_script" src="chrome-extension://aefehdhdciieocakfobpaaolhipkcpgc/content_scripts/copy.js"></script><head>
<title>Rules - GLPI</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
// 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) {
@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);
@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 / 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