Postgres - View all connections details

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

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

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

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

2020 - Public holidays in Poland

This snippet can be helpful both for Rails apps and Developers themselves :)

Fix nokogiri installing error (libxml2)

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)

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

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

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

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

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

Rails ERD diagram visualisation online

Manual: 1. Go to 2. Click *import* and choose *Import from Rails (schema.rb)* 3. Paste schema.rb content 4. voilĂ

How to add polish dictionary to postgres

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

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

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!

How to deal with RSpec time precision error

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.

Open Source GUI macOS archiver with support for 7-Zip

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

How to hold Mac from going into sleep?

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

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

RSpec rerun failures

How to configure RSpec to rerun failed specs only

ThisPersonDoesNotExist, A Website That Uses AI To Make Fake Human Faces the website has the capabilities of conjuring up an image using the GAN algorithm. The GAN works by splitting the ta...

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

Ruby releases: Ruby On Rails releases:

How to set maximum backup size in time machine

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

Rails migration decimal precision scale

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