Skip to content

Instantly share code, notes, and snippets.

View sivsushruth's full-sized avatar

Sushruth Sivaramakrishnan sivsushruth

View GitHub Profile
@joshuachestang
joshuachestang / auth_mailer.rb
Last active November 24, 2015 18:09
Using SendWithUs with Custom Devise Mailer and sendwithus_ruby gem
class AuthMailer < Devise::Mailer
require 'rubygems'
require 'send_with_us' #after installing sendwithus_ruby gem, require the send_with_us.rb initializer file
helper :application # gives access to all helpers defined within `application_helper`.
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
default from: "you@example.com"
def confirmation_instructions(record, token, opts={})
@tagrudev
tagrudev / yolo
Last active May 13, 2017 13:51
YOLO practices #RubyOnRails
# Do not refactor, it is a bad practice. YOLO
# Not understanding why or how something works is always good. YOLO
# Do not ever test your code yourself, just ask. YOLO
# No one is going to read your code, at any point don't comment. YOLO
# Why do it the easy way when you can reinvent the wheel? Future-proofing is for pussies. YOLO
@karmi
karmi / workers.rake
Created July 22, 2010 15:58
Rake taks to launch multiple Resque workers in development/production with simple management included
# Rake task to launch multiple Resque workers in development/production with simple management included
require 'resque/tasks' # Require Resque tasks
namespace :workers do
# = $ rake workers:start
#
# Launch multiple Resque workers with the Rails environment loaded,
# so they have access to your models, etc.