Skip to content

Instantly share code, notes, and snippets.

View Sprachprofi's full-sized avatar

Judith Meyer Sprachprofi

View GitHub Profile
@eliotsykes
eliotsykes / multiline_expressions_in_ruby.md
Last active September 28, 2023 08:03
Multiline expressions in Ruby

How to break long lines up in Ruby

This page lists the options for breaking single-line expressions into multiple lines in Ruby.

Developers and teams need to come to their own decisions about which guideline(s) they prefer (preferences below are just my personal choices and I encourage you to disregard them).

# With trailing parens
x = [1, 2, 3].join(
 '-'
@mirrec
mirrec / delete_mails_imap.rb
Last active May 24, 2022 10:05
how to delete email from mailbox with ruby and imap
require "net/imap"
imap = Net::IMAP.new("imap.domain.sk")
imap.login("info@domain.sk", "HESLO")
imap.select("inbox")
# search for emails that you want to delete
bad_messages = imap.search(["FROM", "from@gmail.com"])
puts "#{bad_messages.count} messages will be deleted"