Skip to content

Instantly share code, notes, and snippets.

View foguinhoperuca's full-sized avatar
🏠
Working from home

Jefferson Campos foguinhoperuca

🏠
Working from home
View GitHub Profile
@foguinhoperuca
foguinhoperuca / encrypted_credentials_read.rb
Created June 28, 2021 19:38 — forked from francescob/encrypted_credentials_read.rb
access rails 5.2 encrypted credentials from a script outside the rails app
#First of all, require all of rails (maybe it doesn't need to be all, but for now it is)
require 'rails/all'
#then i need to slightly overwrite a rails method:
def encrypted(path, key_path: "config/master.key", env_key: "RAILS_MASTER_KEY")
ActiveSupport::EncryptedConfiguration.new(
config_path: path,
key_path: key_path,
@foguinhoperuca
foguinhoperuca / github-pandoc.css
Created November 29, 2018 03:50 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
(require 'iimage)
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
(add-to-list 'iimage-mode-image-regex-alist '("@startuml\s+\\(.+\\)" . 1))
;; Rendering plantuml
(defun plantuml-render-buffer ()
(interactive)
(message "PLANTUML Start rendering")
(shell-command (concat "java -jar /usr/local/plantuml.jar "