This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If there is any application listening to port 8081 (which is the one used to deploy the app) kill it. | |
if lsof -ti tcp:8081 &> /dev/null; then | |
# if there is someone running in port 8081 | |
lsof -ti tcp:8081 | xargs kill | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
sleep(1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.global _gm_pintarFranjas | |
@; Rutina para para pintar las franjas verticales correspondientes a un | |
@; conjunto de franjas consecutivas de memoria asignadas a un segmento | |
@; (de c贸digo o datos) del z贸calo indicado por par谩metro. | |
@;Par谩metros: | |
@; R0: el n煤mero de z贸calo que reserva la memoria (0 para borrar) | |
@; R1: el 铆ndice inicial de las franjas | |
@; R2: el n煤mero de franjas a pintar | |
@; R3: el tipo de segmento reservado (0 -> c贸digo, 1 -> datos) | |
_gm_pintarFranjas: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ verbose=on | |
+ shift | |
+ [[ -n '' ]] | |
+ [[ on != on ]] | |
+ get_simple --jp2a --source /home/aleixmt/.customizer/bin/opensshServer/logo.png -vv | |
+ [[ -n --jp2a ]] | |
++ type -t get_--jp2a | |
+ [[ '' == \f\u\n\c\t\i\o\n ]] | |
+ shift | |
+ [[ -n --source ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Original code in https://www.a1k0n.net/2011/07/20/donut-math.html | |
* | |
* Credits to Andy Sloane (github.com/a1k0n) | |
* | |
* Extracted and refactored the code to be readable in order to study and comprehend it from the original 2016 | |
* I resolved warnings, added some missing type declarations, added reasonable newlines. | |
* Tested in Ubuntu 20.04 | |
* To compile it you need to link the C mathematical library with the -lm option. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shopt -s nullglob | |
rev() | |
{ | |
copy=$1 | |
len=${#copy} | |
for((i=$len-1;i>=0;i--)); do rev="$rev${copy:$i:1}"; done | |
echo $rev | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emoji() { | |
if [ -z "$(echo "${EMOJIS[@]}")" ]; then | |
declare -Ar EMOJIS=( | |
[grinning_face]=馃榾 | |
[grinning_face_with_big_eyes]=馃槂 | |
[grinning_face_with_smiling_eyes]=馃槃 | |
[beaming_face_with_smiling_eyes]=馃榿 | |
[grinning_squinting_face]=馃槅 | |
[grinning_face_with_sweat]=馃槄 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install dependencies | |
sudo apt-get install -y python3 python python-pip curl ffmpeg git | |
# Install PyTube | |
python -m pip install git+https://github.com/pytube/pytube | |
# Use command line to scratch audio from videos in a public YouTube playlist | |
# This will create the folder _Music which will contain all the downloaded audio in mp4 format. | |
pytube https://www.youtube.com/playlist?list=PLsS6gopj1BA1Pi-PlaYlIssTtt -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for cmd in "$@"; do { | |
echo "Process \"$cmd\" started"; | |
$cmd & pid=$! | |
PID_LIST+=" $pid"; | |
} done | |
trap "kill $PID_LIST" SIGINT |