Skip to content

Instantly share code, notes, and snippets.

@ceceppa
ceceppa / execute_and_wait
Created May 9, 2020 09:13
Execute a bash command with a nice spinner util it's completed
#!/bin/bash
# Shell colours
RED='\033[1;31m'
NC='\033[0m'
GREEN='\033[0;32m'
BLUE='\033[1;36m'
MAGENTA='\e[35m'
YELLOW='\e[93m'
CYAN='\e[96m'
@ceceppa
ceceppa / waitTransition.js
Last active May 9, 2020 09:09
Wait for jQuery transition to finish before applying the next chained command
function whichTransitionEvent() {
let t;
const el = document.createElement('fakeelement');
const transitions = {
transition: 'transitionend',
OTransition: 'oTransitionEnd',
MozTransition: 'transitionend',
WebkitTransition: 'webkitTransitionEnd',
};