Skip to content

Instantly share code, notes, and snippets.

View tolosa's full-sized avatar

Leonardo Tolosa tolosa

  • Buenos Aires, Argentina
View GitHub Profile
@tolosa
tolosa / application_helper.rb
Created April 29, 2019 00:21
Arbre view helper for Rails
module ApplicationHelper
def arbre(content = nil, &block)
Arbre::Context.new({ contents: (capture(&content).html_safe if content) }, self, &block).to_s
end
end
@tolosa
tolosa / bullet.rb
Last active May 29, 2017 13:14
Bullet preferred configuration
return unless Rails.env.development?
Bullet.enable = true
Bullet.console = true
Bullet.add_footer = true
Bullet.rails_logger = true
@tolosa
tolosa / application_policy.rb
Last active March 27, 2017 09:42
Pundit default configuration
class ApplicationPolicy
attr_reader :user, :record, :error_message
def initialize(user, record)
@user = user
@record = record
end
def index?
@tolosa
tolosa / nokogiri.sh
Created March 21, 2017 03:53
Bundle configuration to install nokogiri with system libraries
bundle config build.nokogiri --use-system-libraries
@tolosa
tolosa / .pryrc
Created March 9, 2017 03:40
pry-byebug stepping commands aliases
if defined?(PryByebug)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end
@tolosa
tolosa / .gemrc
Created March 9, 2017 03:16
Disable documentation generation on gem install
gem: --no-document
# move existing files to Google Drive
mv ~/.zshrc ~/Google\ Drive/Dotfiles/zshrc
mv ~/.oh-my-zsh ~/Google\ Drive/Dotfiles/oh-my-zsh
# symlink file back to your local directory
ln -s ~/Google\ Drive/Dotfiles/zshrc ~/.zshrc
ln -s ~/Google\ Drive/Dotfiles/oh-my-zsh ~/.oh-my-zsh