Skip to content

Instantly share code, notes, and snippets.

View nihilismus's full-sized avatar

Antonio Hernández Blas nihilismus

View GitHub Profile
@nihilismus
nihilismus / conky-cmus.py
Last active December 12, 2020 11:49
A Python script to get artist, album and title from cmus and send it to stdout. Useful for conky
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# For conky's configuration file ($HOME/.conkyrc):
# ${if_running cmus}
# ${execi 03 (conky-cmus.py)}
# ${endif}
from subprocess import check_output
from re import match, compile
@nihilismus
nihilismus / Retag-Yukito_s-1001-Anime-OPs-EDs.bash
Created August 25, 2020 21:50
Retags the mp3s inside 'Yukito's 1001 Anime OPs & EDs' directory
#!/usr/bin/env bash
# Copyright © 2020 Antonio Hernández Blas <hba.nihilismus@gmail.com>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
@nihilismus
nihilismus / randwup.bash
Created July 10, 2020 17:30
randwup: Download a random wallpaper from wallpaperup.com based on search results (restricted to the first 3 pages result)
#!/usr/bin/env bash
# Copyright © 2020 Antonio Hernández Blas <hba.nihilismus@gmail.com>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
@nihilismus
nihilismus / nerd-fonts-update.bash
Last active June 11, 2020 15:45
Bash script to install the latest version of Nerd Fonts (https://www.nerdfonts.com) from its GitHub repository.
#!/usr/bin/env bash
# Copyright © 2020 Antonio Hernández Blas <hba.nihilismus@gmail.com>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
#!/usr/bin/env bash
# Mini Scraper 2
# https://pywombat.com/exercises/e770767b
# Author: Antonio Hernández Blas <hba.nihilismus<at>gmail.com>
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
@nihilismus
nihilismus / README
Created January 28, 2018 17:10
SlackBuild for menulibre (https://bluesabre.org/projects/menulibre/). Tested in Slackware64 14.2. Slackware Linux
MenuLibre is an advanced menu editor that provides modern features
in a clean, easy-to-use interface and full quicklist support. All
without GNOME dependencies, so even lightweight systems can benefit
from the sanity that MenuLibre offers. MenuLibre is your one-stop
shop for menus in Linux, whether you use Gnome, LXDE, XFCE, or Unity.
@nihilismus
nihilismus / recursividad.clj
Last active December 23, 2017 15:54
Ejemplos de recursividad en Clojure
(ns recursividad)
;; Ejemplos de recursividad en Clojure
;; Lecturas:
;; http://biolab.uspceu.com/aotero/recursos/docencia/TEMA%207.pdf
;; https://gheize.wordpress.com/2007/09/28/recursividad/
;; http://www.grycap.upv.es/gmolto/docs/eda/EDA_Tema_5_Parte_I_gmolto.pdf
;; Tipos de recursividad lineal:
@nihilismus
nihilismus / Main.java
Created July 4, 2017 02:35
Main.java: $ java -jar operaciones.jar "+" 10 20 30 40 50
package operaciones;
import java.util.ArrayList;
import java.util.List;
public class Main {
/*
* args <- [] -> "Excepción."
* args <- ["@" "10" "20" "30"] -> "Excepción."
@nihilismus
nihilismus / rfc.clj
Created May 9, 2017 12:39
Dígito verificador del RFC (México) y RUT (Chile) en Clojure.
(ns plf.rfc)
;; Registro Federal de Contribuyentes (México)
;; El Registro Federal de Contribuyentes (o RFC) es una clave que requiere
;; toda persona física o moral en México para realizar cualquier actividad
;; económica lícita por la que esté obligada a pagar impuestos a toda persona
;; moral, con algunas excepciones.
;; - https://es.wikipedia.org/wiki/Registro_Federal_de_Contribuyentes_(M%C3%A9xico)
;; Procedimiento para calcular el dígito verificador del Registro Federal de Contribuyentes
@nihilismus
nihilismus / chruby-ruby-build-mksh.md
Last active January 30, 2017 01:30
chruby + ruby-build / mksh

chruby + ruby-build / mksh

  1. Install chruby and ruby-build with git. I keep their repo at ~/.chrb, their installation inside ~/local and my rubies at ~/.chrb/rubies.
  2. Copy this in your ~/.mkshrc file
# chruby + ruby-build
chrb() {
    source ~/local/share/chruby/chruby.sh
    unset RUBIES
    RUBIES=$(ls -d ~/.chrb/rubies/* 2> /dev/null)