Skip to content

Instantly share code, notes, and snippets.

View eliasdorigoni's full-sized avatar

Elías Dorigoni eliasdorigoni

View GitHub Profile
@eliasdorigoni
eliasdorigoni / userscript.js
Last active September 15, 2022 18:23
Light theme for Kibana users that can't change it. It changes dark CSS files to use light alternatives, forces CSS with !important or changes style attributes if that's not possible.
// ==UserScript==
// @name Elastic Light Theme
// @description Replaces dark themes with light ones
// @author Elias Dorigoni
// @include https://your.kibana.url/*
// @version 1.0
// ==/UserScript==
window.clearTimeout = window.clearTimeout.bind(window);
window.clearInterval = window.clearInterval.bind(window);
@eliasdorigoni
eliasdorigoni / disable-bouncing-macos.sh
Last active July 19, 2022 18:39
Disable app bouncing notification effect in MacOS dock
# Execute this on the terminal to disable app bouncing.
# Tested on MacOS 12 Monterey. It may work on other versions.
defaults write com.apple.dock no-bouncing -bool TRUE
killall Dock
# ---
# Change TRUE to FALSE to restore the effect.
defaults write com.apple.dock no-bouncing -bool FALSE
killall Dock
@eliasdorigoni
eliasdorigoni / restart-docker.sh
Created July 19, 2022 18:33
Bash function to restart Docker (MacOS only)
#!/usr/bin/env bash
# This is meant to be appended to .bash_aliases or .zsh_aliases
#
# The `docker-restart` command allows the user to restart Docker and wait for it
# to be ready before executing the next command.
function docker-is-ready() {
timestamp=$(date +%s)
while [[ -z "$(! docker stats --no-stream 2> /dev/null)" ]]
do
@eliasdorigoni
eliasdorigoni / armarArbolTaxonomias.php
Created February 17, 2016 23:09
Ejemplo de recursividad en taxonomias de WordPress
<?php
/**
* Arma recursivamente un arbol con las taxonomias jerárquicas.
* Devuelve un array.
* @param object $terms retorno de get_terms
* @return array
*/
function armarArbol($terms, $padre = 0, $profundidad = 0) {
if($profundidad >= 8) return '';
$retorno = array();