Skip to content

Instantly share code, notes, and snippets.

View rubencaro's full-sized avatar

Rubén Caro rubencaro

View GitHub Profile
@rubencaro
rubencaro / .emacs
Last active August 29, 2015 14:02
Emacs config
;; 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
rubencaro / gist:9545060
Last active May 7, 2020 20:59
Reversible encryption for url json data
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' }