Skip to content

Instantly share code, notes, and snippets.

View etra0's full-sized avatar
need more coffee

Sebastián A. etra0

need more coffee
View GitHub Profile
#!/bin/bash
# Script to change wallpaper
DIREC="/home/user/Imágenes/Wallpapers"
cd $DIREC
IMAGE="$(ls -1 | sort -R | head -n 1)"
export DISPLAY=:0
gsettings set org.gnome.desktop.background picture-uri "file://$DIREC/$IMAGE"
@etra0
etra0 / range.rkt
Last active October 15, 2016 04:24
#lang scheme
(define range
(lambda (future_list)
(if (list? future_list)
(if (= (car future_list) 0)
future_list
;else
(range (cons (- (car future_list) 1) future_list))
)
;else
@etra0
etra0 / minuta.py
Last active October 30, 2016 20:51
Para ver la minuta de la usm
import sys
import requests
import time
ROJO = "\033[31m{0}\033[0m"
VERDE = "\033[92m{0}\033[0m"
try:
minuta = requests.get('http://www.usm.cl/comunidad/servicio-de-alimentacion/')
except:
sys.exit(ROJO.format("Time out"))
url=$1
album_id="${url##*/}"
json_data="`curl -s http://imgur.com/ajaxalbums/getimages/$album_id/hit.json`"
for line in $json_data; do
image_id="`echo $line | grep -o '"hash":"[A-Za-z0-9]*"' | perl -pe 's/"hash":"(.*)"/$1/g'`"
if [ ! -z $image_id ]; then
wget "i.imgur.com/$image_id.jpg"
fi
done
@etra0
etra0 / nfa_to_dfa.py
Last active April 15, 2017 00:13
Script that returns a table in latex format to convert from NFA to DFA =)
"""
The NFA is a dictionary composed by:
'state': [(char, new_state)]
"""
NFA = {
'a': [['0', 'a'],('0', 'e'), ('1', 'e'), ('0', 'd'), ('1', 'd'), ('0', 'c'), ('0', 'b')],
'b': [('1', 'e'), ('0', 'c')],
'c': [('1', 'b')],
'd': [('0', 'e')],
'e': []
@etra0
etra0 / link_crunchyroll.sh
Created April 13, 2017 21:08
This script was made to navigate through the chapters of a serie without opening crunchyroll in the browser.
@etra0
etra0 / README.md
Last active April 23, 2017 19:40
GoT screen on time until season3

I searched for the time on screen of every character on Game Of Thrones. I found the information until season 3 only. Here's the result:

GOT

@etra0
etra0 / README.md
Last active July 3, 2017 07:27
Screen time of every character in Game of Thrones

I found the info of the time in screen of GOT's characters. I made the csv and the plot using python3.

Here is the result: plot

#!/usr/bin/python
from time import time, sleep
from random import randint
import random as r
RUTS = ['19.470.140-3',
'20.067.784-k',
'10.481.357-7',
'11.624.369-5',
'15.753.502-1',
@etra0
etra0 / README.md
Created July 13, 2017 22:50
Game of Thrones Screen Time

You need to download the source of the data (the html) of IMDb and save it as data.html, then run parse_imdb.py, this will generate the csv.

Then you can run plot.py.

Remember to use python3