Skip to content

Instantly share code, notes, and snippets.

View annibal's full-sized avatar

Arthur Annibal annibal

View GitHub Profile
@annibal
annibal / makeKeyTester.js
Created August 1, 2024 15:13
Appends an input to the current page and logs events to the console
function makeKeyTester(
listeners = ['keydown'],
handler = (l, e) => { e.preventDefault(); console.log(l,e); return false; }
) {
if (!Array.isArray(listeners)) {
throw new TypeError('listeners must be an Array');
}
if (!typeof handler === "function") {
throw new TypeError('handler must be an Function');
}
@annibal
annibal / ONBEFORE_UN_LOADD.html
Created August 14, 2024 20:37
EXIT - Prevent Leaving webpage andmake requests informing of such action - An Proof of Concept
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ONBEFORE UN LOADDDD</title>
<style>
:root {
--border-radius: 4px;
@annibal
annibal / .zshrc
Last active September 13, 2024 01:10
repostatus - Shell code for Colmeia's Multi-Repo status quick management
# ...
# export ZSH="$HOME/.oh-my-zsh"
# ZSH_THEME="robbyrussell"
# ...
# source $ZSH/oh-my-zsh.sh
# ...
source ~/scripts/repostatus.sh;
colmrepostatus() {
@annibal
annibal / repo-print-everything.sh
Last active September 25, 2024 17:31
Print all file names and content, recursively, from a Project's root folder, into an output file. Use to ask GPT to create a README for the Project.
find . -name ".py" | while read -r file; do
sed -i .bak '/^#/d' "$file";
sed -i '' "1s|^|# ${file}\n|" "$file";
done;
find . -name ".py" -exec cat {} + | pbcopy;
find . -name "*.bak" -type f -delete
@annibal
annibal / fix-colmeia-chat.js
Last active September 26, 2024 18:12
FixColmeiaChat
(function FixColmeiaChatFactory() {
// Will execute the fix, at the end of this script,
// Will assign an object with the props and the methods: window.FixColmeiaChat,
// Will return the object as well.
var props = {
// config max attempts of trying to find the <colmeia-chat> element
retryTimeout: 600,
retryAttempts: 6,
// only for debugging, if necessary
@annibal
annibal / jequiti-blinker.js
Last active October 25, 2024 20:55
Every 5 ~ 30 seconds, randomly, shows an JEQUITI image fullscreen covering the web page, for a few seconds, then hides and deletes it
const commonStyles = "display: block; position: fixed; z-index: 9999999; transition: opacity 100ms ease; left 100ms ease; top: 100ms ease; right: 100ms ease; bottom: 100ms ease; width: 100ms ease; height: 100ms ease;"
const jequitiSettings = {
min: 5000,
max: 30000,
duration: 500,
waitLoad: 1000,
waitRemove: 200,
tid: null,
src: "https://fraguru.com/mdimg/dizajneri/o.1954.jpg",
id: "jequiti-overlay",
@annibal
annibal / list_recently_active_repos.js
Last active April 22, 2025 18:11
Azure : list Project's recently active Repos
async function listMostRecentlyActiveRepos(org, project, maxCommits=15) {
const base = `https://dev.azure.com/${org}/${project}/_apis/git/repositories?api-version=7.1-preview.1`;
const repos = await fetch(base).then(r => r.json());
const activeRepos = [];
const data = []
for (const repo of repos.value) {
const commitsUrl = `https://dev.azure.com/${org}/${project}/_apis/git/repositories/${repo.id}/commits?$top=${maxCommits}&api-version=7.1-preview.1`;