Quantcast
Channel: EquiValent
Browsing latest articles
Browse All 112 View Live

How to store image width & height in Rails ActiveStorage

According to ActiveStorage Overview Guild there is already existing solution image.file.analyze and image.file.analyze_later (docs ) which uses ActiveStorage::Analyzer::ImageAnalyzerAccording to...

View Article


Pitfalls of Rails db transactions

Rollback Rails transaction and rescue error to display itgood:This is finerecord = MyModel.last error_for_user = nil begin ActiveRecord::Base.transaction do # ... record.save! end rescue...

View Article


Image may be NSFW.
Clik here to view.

ImageMagic cache resources exhausted

We are living in a age of ridiculous smartphone cameras. Chances are you will see user uploading 108 Megapixel images and your ImageMagic crushing when processing it. convert source.jpg -auto-orient...

View Article

Ubuntu OpenSSH Server config

Generate ssh keyssh-keygen -t rsa -b 4096 -C...

View Article

Rails PostgreSQL find by nested JSON / JSONb field

Imaging Rails model SubscriptionsHistory with json field data that has nested JSON: subscription.idSo SubscriptionsHistory.attributes would return:{"id"=>654321, "data"=> {"subscription"=>...

View Article


Embed Google Maps JS with Stimulus JS

// app/javascript/controllers/map_controller.js export default class extends Controller { static targets = [ 'map' ] connect () { if(this.hasMapTarget) { let lat =...

View Article

Rails ActiveStorage AWS S3 bucket policy permissions

Steps:create a AWS s3 bucket and then create a new AWS IAM user:create new user in AWS IAM (copy access_key and sectet and store them to Rails credentials)on “Set Permission” step click on “Attach...

View Article

Publicly accessible Elasticsearch 7.x

how to expose ElasticSearch on a VM globaly (public access)or: How to access ElasticSearch 7.x installed on a VM from my laptopnote this is a terrible idea! don’t do this for production ES. This is...

View Article


Image may be NSFW.
Clik here to view.

Add Goddady ssl certificate to AWS Load Balancer

Assuming you’ve already generated the csr files and private key without password and you already have SSL certificate issued by GoDaddyIn GoDaddy go to https://certs.godaddy.com/ in Certs pic...

View Article


AWS ElasticBeanstalk update ssh welcome message (motd)

In order to update welcome message after ssh a.k.a message of the day (motd) we need to write our custom motd script to the AWS ElasticBeanstalk (EB) EC2 instace...

View Article
Browsing latest articles
Browse All 112 View Live