most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
#! /usr/bin/env ruby | |
# usage: | |
# $ das_download.rb email password [download_directory] | |
require 'mechanize' | |
# gem 'mechanize-progressbar' | |
email = ARGV[0] or raise('Please provide the email address for your account') | |
password = ARGV[1] or raise('Please provide the password for your account') | |
path = ARGV[2] || './' |
This are different examples of doing the same thing, "mark a notification as read", and the pros and cons that I see in each example
class MyMailer < ApplicationMailer | |
def send_invoice user, invoice | |
@user = user | |
@invoice = invoice | |
invoice_attachment = WickedPdf.new.pdf_from_string(render_to_string(pdf: "invoice", template: 'payments/charges/invoice.pdf.erb')) | |
attachments["I#{sprintf('%06d', @invoice.id)}.pdf"] = invoice_attachment | |
mail(to: @user.email, | |
subject: "Your invoice", template_path: 'users_mailer') | |
end | |
end |