Quantcast
Channel: EquiValent
Browsing all 112 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Visualized Desktop Workspace flow in Manjaro linux 18 - XFCE

This article is manual how to set up Manjaro linux 18 - XFCE so it works with Visualized Workspaces Workflow conceptVisualized Workspaces flow is a setup of workspaces in Desktop Environment for...

View Article


Image may be NSFW.
Clik here to view.

Visualized Desktop Workspace flow in Xubuntu 18.04 - XFCE

This article is manual how to set up Xubuntu so it works with Visualized Workspaces Workflow concept. This setup should probably work also for Ubuntu with manually installed XFCEVisualized Workspaces...

View Article


Why you should consider Bounded Contexts in Rails

This TIL note is extension of arguments for my article Ruby on Rails - Bounded contexts via interface objectsIn traditional Ruby on Rails application you organize code in this way:app controllers...

View Article

How to launch Rails console in specific Docker image or Docker container

docker-compose runGiven you have docker-compose e.g.# docker-compose.yml version: '3' services: my_application: image: name_of_my_image:latest build: context: . dockerfile: Dockerfile # ......

View Article

Rails sequence error on postgresql db

Recently my staging DB start throwing ActiveRecord::RecordNotUnique PG::UniqueViolation: ERROR: duplicate key value violates unique constraint error.I don’t fully understand how the error happened...

View Article


Visualized Desktop Workspace flow in Ubuntu 18.04

This article is manual how to set up Ubuntu 18.04 so it works with Visualized Workspaces Workflow concept. This setup should probably work also for Ubuntu with manually installed XFCEVisualized...

View Article

PG::UniqueViolation: ERROR: duplicate key value violates unique constraint

ActiveRecord::RecordNotUnique PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "table_names_pkey" DETAIL: Key (id)=(70) already exists. : INSERT INTO "table_names"Moste of the...

View Article

What page should the pagination start from ?

Recently I had discussion: Should the pagination start from page 1 or from page 0 ?Pagination starting from page 1 - Book-like paginationIt’s similar to numbering a book pages. First page with content...

View Article


Image may be NSFW.
Clik here to view.

How to rotate video on Youtube

Youtube “rotate video” feature was not removed just hidden in Youtube studio Clasic.I’ll show you how you can access it but you must have basic understanding of what is “Browser element inspector” and...

View Article


Retry ActiveJob (Sidekiq) on exception

Let say we have a simple Ruby on Rails ActiveJob background job that would do something in a Background. For example# app/jobs/new_work_published_job.rb class NotifyThatWorkWasPublishedJob <...

View Article

RSpec mocks in Rails native tests (minitest)

I love RSpec but recently I’ve decided to build sideproject with 100% Rails 6 vanilla environment (that means no extra gems, just what is inside Rails 6, including the Minitest test environment)Problem...

View Article

Create AWS S3 bucket as a static website with AWS CLI

In this TIL note I’ll create static website hosted on AWS S3 bucket using only AWS CLI.We will create dummy static website on bucket called happy-bunnyCreate bucket# create s3 bucket via AWS CLI aws...

View Article

Image may be NSFW.
Clik here to view.

Custom domain / subdomain for website hosted on AWS S3

You can configure Amazon Web Services (AWS) S3 buckets to host static websites (e.g. static HTML+CSS+JavaScript website or Single Page App (SPA) Frontend )In this Article I’ll show you how to set AWS...

View Article


Image may be NSFW.
Clik here to view.

Software Philosophy Quotes and Memes

Conway’s lawConway’s law is an adage stating that organizations design systems that mirror their own communication structure.If project you work for has 3 different teams that communicate in isolation,...

View Article

Image may be NSFW.
Clik here to view.

RSpec Rails controllers test examples

Here are some RSpec examples on how I like to test Ruby on Rails controllersI’ll be adding more soonHow I use controller testsIn my opinion controller specs should touch multiple layers of...

View Article


Ruby array

Here is some list of Ruby Array operations and examples.I’m just pasting here some cool examples for lates Ruby I use. Pls check full list of Array features for your Ruby versionRuby 2.7.0 Arraydetect...

View Article

Image may be NSFW.
Clik here to view.

Issue with removing/deleting element from Ruby Array

Imagine this situation:a = [1, 2, 3 ] b = a b.delete(2) b #=> [1, 3] a #=> [1, 3] Similar dangerous situation happens when you add elements to Array:c = [1, 2, 3 ] d = c d << 4 d #=> [1,...

View Article


Run Rails script as an ActiveJob job

…or how to run Ruby on Rails script as a Sidekiq job, delayed_job job, …How do you run scripts on your production Ruby on Rails server ?In most small/medium projects it’s enough just to ssh to a server...

View Article

Image may be NSFW.
Clik here to view.

Rails ActiveStorage - crop and resize image variant

Active Storage image variants can run on two different engines: MiniMagic/Imagemagic or ruby-vips/libvips which variant options have different syntax. The following will work for MiniMagic/Imagemagic...

View Article

Stimulus JS Cheat Sheet

Rails 6 Stimulous JS Cheat SheetOfficial docs stimulusjs.orgController namesfile: snake_case.js identifier: kebab-caseAlways use dashes in data-controller values for multi-word controller identifiers....

View Article
Browsing all 112 articles
Browse latest View live