Ruby logger log levels
Public

OK, it seems obvious but I always spend several minutes finding it. So I think it's a good idea to put it here.

Unlock devise user using command line?
Public

If you are using the Devise lockable module and locked user access (usually during the development) use this method to unlock it.

How to restart unresponsive Touch bar on MacOS
Public

Just open your terminal and ...

Cleaning schema.rb
Public

Since [apartment](https://github.com/influitive/apartment) uses `schema.rb` as a source for new schemas, it is important to keep this file clean. Running mig...

Fix openssl error (macOS, ruby 2.3)
Public

So, you're trying to setup an Ruby 2.3.X-powered Rails app and it complains about openssl? Using a Mac? You're not the first. I've also been there. Let's get this nasty bug out of your way!

PURGECSS: Jak usunąć zbędny CSS
Public

Poznaj Purgecss, czyli narzędzie pozwalające na zmniejszenie rozmiaru plików CSS i sprawdź, jak z niego korzystać. Ile CSS importowanego z bibliotek zewnę...

https://bulldogjob.pl/news/945-jak-usunac-zbedny-css

Postgres - View all connections details
Public

Postgres server with limited connection pool can experience issues when all connections are occupied by some process. Here you'll learn how to get more details about them to mitigate this issue.

libpng12 in Ubuntu 18.04 LTS
Public

Some programs require libpng12 to work - but this library is no longer present in up-to-date Ubuntu versions. Here you'll find out how to install it.

How to detect time-overlapping-records in Postgres + Rails
Public

```ruby Model .where("TSRANGE(?, ?, '()') && TSRANGE(starts_at, ends_at, '()')", starts_at, ends_at) .where.not(id: record_id) .exists? ``` Bot...

Fix nokogiri installing error (libxml2)
Public

While running bundle install in Rails app you haven't used previously, you may encounter `ERROR: cannot discover where libxml2 is located on your system.` error. This indicates that Ruby can't find libxml2 - although it's probably installed, with Xcode! Here you'll see how to resolve this issue.

Strange behaviour of roo gem when working with sheets (tabs)
Public

Recently I realised a strange behaviour of roo gem when working with sheets (tabs). Here's what works non-intuitively in my opinion.

How to generate Excel column symbols in Ruby - Cool one-liner #1
Public

How to generate Excel column symbols in Ruby ``` ('A'..'Z').to_a.unshift(nil).product(('A'..'Z').to_a).map { |arr| arr.compact.join } ``` If you woul...

Implement .node-version file in Bash & NVM (Also for ZSH!)
Public

This snippet will allow you to automatically load node version stored in `.node-version` while changing current directory.

Rails ERD diagram visualisation online
Public

Manual: 1. Go to https://dbdiagram.io/d 2. Click *import* and choose *Import from Rails (schema.rb)* 3. Paste schema.rb content 4. voilà

https://dbdiagram.io/d

How to Address a Lady in a Business Letter
Public

How to Address a Lady in a Business Letter? Here some advises. ## Not married `"Ms. #{last_name}"` or `"Miss #{last_name}"` ## Married `"Mrs. #{l...

How to deal with RSpec time precision error
Public

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.

How to restore DB from SQLC file
Public

`pg_restore -d db_name /path/to/sqlc/file.sqlc`

Open Source GUI macOS archiver with support for 7-Zip
Public

This program will help you compress and extract 7-Zips (and other popular archive formats) without using command line.

https://www.keka.io/en/

TCP Server in Elixir
Public

How to setup a simple, but robust TCP server in Elixir

How to be up to date with Ruby and Ruby On Rails releases
Public

Ruby releases: https://www.ruby-lang.org/en/downloads/releases/ Ruby On Rails releases: https://rubygems.org/gems/rails/versions

How to set maximum backup size in time machine
Public

To set maximum backup size run this command in shell...

Rails migration decimal precision scale
Public

Rails migration decimal precision scale explained quasi visually ``` 123.45678912345 <- scale -> <- precision -> ```