Skip to content

Instantly share code, notes, and snippets.

View royrscb's full-sized avatar

Roy Ros Cobo royrscb

View GitHub Profile
@royrscb
royrscb / matrix.sh
Created April 16, 2019 23:43
Matrix effect for linux terminal, working not in parallel
#!/bin/bash
##########################
# Author: Roy Ros Cobo ###
##########################
CHARSET=(ア イ ウ エ オ カ キ ク ケ コ サ シ ス セ ソ タ チ ツ テ ト ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ マ ミ ム メ モ ヤ ユ ヨ ラ リ ル レ ロ ワ ン A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9)
MAX_LINES=60
ROWS=$(tput lines)
@royrscb
royrscb / video-converter.sh
Last active April 16, 2019 23:58
Video converter cut and accelerates
#!/bin/bash
#############################
#Author: Roy Ros Cobo #######
#############################
# VARS TO SET #####################################################
filesDir='../toConv'
# destDir is relative to filesDir
destDir='../converted'
@royrscb
royrscb / dailies.sh
Created April 16, 2019 23:51
Get daily pictures from nasa and national geographic
#!/bin/bash
###########################
#Author: Roy Ros Cobo ###
###########################
carpeta="/home/$USER/Pictures/dailies"
###########################################
ping -c 1 -w 1 8.8.8.8 > /dev/null; if [ $? -ne 0 ]; then echo 'No internet connection!'; sleep 1; exit; fi
@royrscb
royrscb / set_modalImgs.js
Last active October 21, 2019 13:01
Make pop up images for every image with modal-img class. Display subtext if attr subtext is set. With arrow keys it switch between modal-img images.
setModalImgs(){
// CLICK -----------------------------------------------------
$(document).on('click', '.modal-img', function(e){
const TARGET = e.target,
SCREEN_RATIO = (window.innerWidth -100)/(window.innerHeight -100),
IMG_WIDTH = TARGET.naturalWidth,
IMG_HEIGHT = TARGET.naturalHeight,
IMG_RATIO = IMG_WIDTH/IMG_HEIGHT,