Skip to content

Instantly share code, notes, and snippets.

require 'ruby-progressbar'
res = ActiveRecord::Base.connection.execute(<<~SQL).to_a
select customer_reference_number, email, mobile_number, country_code
from users
where mobile_number is not null
and mobile_number != ''
SQL
progressbar = ProgressBar.create total: res.size,
1. In the view template we put some formated comment that should link to the stylesheet that
will be used in this template.
2. Create sprockets preprocessor that converts the class names into predefined pattern:
- The preprocessor should be configurable so that for different environments it should be
possible to generate different hashed versions of the class names e.g. `[hash]`,
`[class_name]__[file_name]__[hash]`, the hash should also be configurable so the user can specify
how long it should be.
- Goes through the view template and finds the css classes.
- According to some configuration generates some sort of a hash for the given string.

Keybase proof

I hereby claim:

  • I am lucole on github.
  • I am luco (https://keybase.io/luco) on keybase.
  • I have a public key ASABIbfvEMVb8Z3LW7w_AAubpjPRNfpx_QqCE5kAexhijwo

To claim this, I am signing this object:

@LucoLe
LucoLe / _coding_challenge.md
Last active August 9, 2017 11:50 — forked from JohnBDonner/_coding_challenge.md
Coding Challenge

Description

Imagine we have a book model and chapter model. Both models have attributes that needs to have sanitized html. We use a gem called sanitizer to sanitize the text. Now how would you refactor this code to be more DRY and scalable? Bonus: How would you test this?

Directions:

  • Clone the gist
  • Modify the code (change these files or add your own)
  • Save your modifications as a forked gist
  • Respond to the Breezy email with a link to your gist