Skip to content

Instantly share code, notes, and snippets.

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

Juarez Lustosa JuarezLustosa

🏠
Working from home
View GitHub Profile
Ruby e Rails
Guias:
http://guides.rubyonrails.org/
Livros (Free mas vale pagar um café para o autor ;) ):
https://leanpub.com/conhecendo-ruby
Livros (Pagos):
https://leanpub.com/conhecendo-rails
@JuarezLustosa
JuarezLustosa / 00.md
Created November 19, 2018 15:56 — forked from maxivak/00.md
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@JuarezLustosa
JuarezLustosa / vim-on-heroku.sh
Created November 7, 2017 18:45 — forked from sfate/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
@JuarezLustosa
JuarezLustosa / filterable.rb
Created February 11, 2016 18:27 — forked from justinweiss/filterable.rb
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with the same name as the keys in <tt>filtering_params</tt>
# with their associated values. Most useful for calling named scopes from
#!/usr/bin/env bash
apt-get -y update
apt-get install build-essential
apt-get -y install zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
apt-get install gcc
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
tar -xvzf ruby-1.9.3-p374.tar.gz
cd ruby-1.9.3-p374/
./configure --prefix=/usr/local
@JuarezLustosa
JuarezLustosa / abilities.rb
Created September 16, 2012 13:34 — forked from ryanb/abilities.rb
How you can break up large Ability class in CanCan
module Abilities
def self.ability_for(user)
if user.admin?
AdminAbility.new(user)
else user
MemberAbility.new(user)
else
GuestAbility.new
end
end