Skip to content

Instantly share code, notes, and snippets.


Rubén Caro rubencaro

  • Barcelona
View GitHub Profile
rubencaro / gist:9545060
Last active May 7, 2020
Reversible encryption for url json data
View gist:9545060
require 'openssl'
require 'digest/sha1'
require 'base64'
require 'json'
def go_demo!
key = Digest::SHA1.hexdigest("clave1")[0..15] # 16bytes => 128bits
iv = 'clave2 con chicha'[0..15] # 16bytes forced
data = { esto: 'es', un: 'hash', en: 'ruby' }
rubencaro / .emacs
Last active Aug 29, 2015
Emacs config
View .emacs
;; TODO:
;; use PROMPT_COMMAND='printf "\033]0;hola\007"' to set term title on project switch
;; use current project name to save desktop to a separate file
;; binding for pgup pgdown to a real text scroll
;; bindings for git-gutter/ediff
;; bindings for neotree
;; use ctags everywhere possible
rubencaro /
Last active Dec 2, 2020
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

View .gitconfig
name = Rubén Caro
email =
co = checkout
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lolas = log --graph --decorate --abbrev-commit --all --date=short --format=format:'%C(yellow)%h %Cgreen%an %Cblue%ad %Cred%d %Creset%s'
a = !bash -c 'git add --all . && git diff HEAD' -
c = commit -am
rubencaro / elixir.xml
Last active Jul 22, 2017
Kate syntax highlight file for elixir
View elixir.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language
SYSTEM 'language.dtd'>
Elixir syntax highlighting definition for Kate.
Copyright (C) 2014 by Rubén Caro (
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
rubencaro /
Last active Aug 29, 2015
py3status modules
# -*- coding: utf-8 -*-
# custom compiled modules for py3status
# ----------------------------------------------------------------- #
# Notes:
# 1. netdata will check 'eth0' interface by default. You can
# change it by changing 'self.net_interface' variable in 'GetData'
# class.
rubencaro / ruby.xml
Created Oct 31, 2014
Ruby syntax file for Kate
View ruby.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
Ruby syntax highlighting definition for Kate.
Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi)
Copyright (C) 2004 by Stefan Lang (
Copyright (C) 2008 by Robin Pedersen (
Copyright (C) 2011 by Miquel Sabaté (
View Mine.kateschema
[Default Item Styles - Schema Mine]
Base-N Integer=ffff54ff,ffff54ff,0,,,,-,-,,---
Data Type=ffc0c0ff,ff54ff54,0,,,,-,-,,---
Floating Point=ffff54ff,ffff54ff,0,,,,-,-,,---
# initialization file (not found)
rubencaro /
Last active Aug 28, 2017
DOT auto render script
function get_mtime {
ls -l --time-style=+%s "${1?}" | cut -d' ' -f6
function go_render {
while true;
You can’t perform that action at this time.