In some cases, Ruby uses higher precision to represent time than the DB. When we compare a timestamp before and after saving to the DB it might not be equal.
Shell script that will start a tmux session with Rails console and server in side panes
Use this syntax to format raw SQL nicely in ruby code. In some editors it also enables SQL syntax highlighting.
This jsx ```react <React.Fragment> <h1>Hello World</h1> <p>This is paragraph</p> </React.Fragment> ``` Will be compiled into this html ```h...
In chrome developer tools go to "Sources" find "Event Listener Breakpoints" and select "Mouse -> mousedown". Now each time the event is triggered, chrome wil...
Organize Pundit error messages and redirects in a decorator. Simplify reuse and maintenance
When you accidentally commit to master/staging and need to move the commit to a feature branch
You can define external urls in routes.rb instead of creating helpers manually
Reset devise passwords quickly, even for thousands of users.
This app allows you to upload screenshots and paste them into a fake phone/laptop mockup.
Configure wicked_pdf with: ```ruby disable_smart_shrinking: true ``` Then you can accurately use `mm` and `cm` as units in your CSS
Replace Font Awesome with modern line icons with a single line of code.
Method memoization in ruby is easy when the method is one line long: ``` def something @something ||= # your calculations end ``` But when we hav...
Recommended by https://pawelurbanek.com/profitable-slack-bot-rails
See the link for setup instructions. Then in ruby: ```ruby conn = Faraday.new(your_slack_webhook_url) conn.post do |req| req.headers['Content-Type'] ...
This guy makes his shared examples easier to understand. Overpaid consultants hate him!
When to use let, let! and before in RSpec.
In your code: ```ruby # TODO: fix this ``` In your shell: ```bash % rake notes ``` ```text config/routes.rb: * [ 1] [TODO] fix this ```