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.

Basic requirements for Facebook Cover Video
Public

Essential requirements for Facebook Cover Video: Recommended resolution: 820 x 462 px Duration: 20 - 90 seconds Filetype: mp4 Remember top and bottom...

https://www.kapwing.com/resources/how-to-make-a-facebook-cover-video/

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 add polish dictionary to postgres
Public

PostgreSQL dictionary consists of 3 files: * lang.dict * lang.affix * lang.stop # Generating dictionary files 1. Download the most recent polish Isp...

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...

jsPDF - JavaScript library for generating PDFs without using backend
Public

Sometimes you wonder if there's a way to generate PDF without dealing with wk*topdf, puppeteer and other massive serverside tools - and there's one - jsPDF - which will generate a PDF for you in a moment, all client-side!

http://raw.githack.com/MrRio/jsPDF/master/

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/

How to hold Mac from going into sleep?
Public

Every Mac owner knows how painful it is if their SSH session with a very important process just disconnects because of Mac going into sleep. Hopefully, there's a way to tell macOS that you don't want it to sleep - and here, you'll learn how to do it.

TCP Server in Elixir
Public

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

RSpec rerun failures
Public

How to configure RSpec to rerun failed specs only