Blog posts
Oct 2, 2024
How to use Cloudflare Workers proxy with Rust
Visits counter was a critical feature of every website just 20 years ago. In this tutorial, we will implement it with Rust Cloudflare Workers by adding persistence and dynamic behaviors to an otherwise static page. We will also discuss other practical use cases of CF workers edge proxy.
Sep 18, 2024
How I've built an unprofitable MEV Bot in Rust
MEV bots are money-printing machines. At least in theory. For the last ~year, I've been working on the MEV crypto bot for Ethereum EVM-compatible chains. In this blog post, I'll describe the ins and outs of trying to get into the MEV game with a limited web3 skillset and relatively small capital.
Aug 27, 2024
Easy to Overlook PostgreSQL Performance Issues in Rails Apps
Performance issues in the PostgreSQL layer usually start to manifest only when your app reaches a certain scale. In this blog post, I'll discuss easy-to-miss database config tweaks and common problems that I've encountered in multiple Rails projects.
Jun 11, 2024
How to Optimize MEV Arbitrage Smart Contract with Yul and Huff
Minimizing gas usage directly impacts the profitability of your MEV bot. In this blog post, we will start with a straightforward but nonoptimal approach for swapping two UniswapV2 pairs and gradually improve it. We will start with Solidity-level fixes and later descend into the lower layers of the Ethereum EVM with Yul and Huff assembly languages.
May 16, 2024
Updated Sep 23, 2024
How to Simulate MEV Arbitrage with REVM, Anvil and Alloy
EVM simulation engine is a core component of any competitive MEV strategy. In this tutorial, I'll describe how to use Anvil and its lower-level counterpart REVM to detect UniswapV3 MEV arbitrage opportunities. We will implement a working proof of concept using alloy-rs (a successor to ethers-rs). I'll also discuss techniques for improving the performance and scalability of REVM-based simulations.
Mar 5, 2024
How learning Rust changed my Ruby Workflow
For the last few months, I've been working semi-full-time on my first Rust project. After the first painful weeks of struggling against The Compiler, I feel I'm now spoiled by Rust development experience. In this blog post, I'll describe improvements to my Ruby workflow that originate from what I've seen in the Rust ecosystem.
Sep 12, 2023
How to Improve Rails Caching with Brotli Compression
Caching is an effective way to speed up the performance of Rails applications. However, the costs of an in-memory cache database could become significant for larger-scale projects. In this blog post, I'll describe optimizing the Rails caching mechanism using the Brotli compression algorithm instead of the default Gzip. I'll also discuss a more advanced technique of using in-memory cache for extreme performance bottlenecks.
May 9, 2023
Five Easy to Miss Performance Fixes for Rails Apps
Improving the performance of a Rails application can be a challenging and time-consuming task. However, there are some config tweaks that are often overlooked but can make a significant difference in response times. In this tutorial, I will focus on a few quick & easy fixes that can have an immediate impact on the speed of your Rails app.
Apr 19, 2023
How to Freeze ETH and ERC20 Tokens using Smart Contract
I’m still the kind of person that buys $500 worth of Dogecoin, and one day later, panic sells with a 30% loss. That's why, I’ve developed Ethereum smart contracts that make speculating on cryptocurrencies less stressful. Locker smart contracts allow me to freeze crypto assets and only release them when enough time has passed or the price has reached a predefined value. This approach sacrifices liquidity for peace of mind, and for me, that’s a perfect tradeoff! In this article, I’ll describe this project and the risks associated with using it or basically any Smart Contract.
Mar 7, 2023
How to Find, Debug and Fix N+1 Queries in Rails
Fixing N+1 issues is often the lowest-hanging fruit in optimizing a Rails app performance. However, for non-trivial cases choosing a correct fix could be challenging. Incorrectly applied eager loading does not work or even worsens response times. In this blog post, I describe tools and techniques I use to simplify resolving N+1 issues.
Feb 16, 2023
How to Subscribe to YouTube Channels Without an Account
I'm extremely cautious with YouTube. I've lost countless hours because of their flawless recommendation algorithms. In one of my previous posts, I describe how to cripple recommendations UI and start using YouTube more deliberately. I also prefer to use YouTube without logging in, but it makes following my favorite channels difficult. So in this tutorial, I describe how to over-engineer your way to subscribing to YouTube channels without having an account.
Jan 10, 2023
Easy to Overlook Way to Break Eager Loading in Rails Apps
In theory, configuring eager loading to avoid N+1 issues is straightforward. Chaining includes method is usually enough to ensure that all the relations data is fetched efficiently. However, this rule breaks for some easy-to-overlook edge cases. In this blog post, I'll describe how to eager load ActiveRecord relations using custom SQL ORDER BY sorting.
Dec 20, 2022
How to Monitor and Fix PostgreSQL Database Locks in Rails
PostgreSQL database locks usually work seamlessly until they don't. Before your Rails app dataset and traffic reach a certain scale, you're unlikely to face any locks-related issues. But if your app suddenly slows down to a crawl, deadlocks likely are to blame. In this blog post, I'll describe how to monitor database locks and propose best practices to prevent them from causing issues.
Dec 5, 2022
Easy to Miss Way to Optimize ActiveRecord SQL Memory Usage in Rails
By default, Rails ActiveRecord executes most of the SQL queries in a non-optimal way. In this blog post, I'll describe how to fix this issue to speed up bottlenecks and reduce memory usage.
Nov 8, 2022
Rails Quick Tip - Use Private Debugging Aliases
I don't like to type much. Even minor improvements in your debugging workflow are likely to accumulate into huge keystrokes savings over time. In this blog post, I'll describe a simple way to add debugging shortcuts to the project without modifying the codebase shared with other team members.
Oct 17, 2022
The In-depth Guide to Caching ActiveRecord SQL Queries in Rails
Caching might seem a perfect solution to speed up slow database queries. However, caching in Rails apps can be easily misused, leading to poor maintainability or even slower performance than without it. In this blog post, I'll discuss the common pitfalls of caching SQL queries in Rails apps. I'll also describe my toolkit for assessing the cacheability of database queries and techniques for reducing the cost of caching infrastructure.
Oct 3, 2022
Simple View Presenter Pattern in Rails without using Gems
What's the size of user.rb file in your current project? The default Rails way model-view-controller architecture often leads to a bloated model layer. Presenter pattern is one of the more straightforward ways to slim down your Rails models. It also helps to reduce the logic in the view layer and makes testing easier. In this blog post, I'll describe how to implement a presenter pattern without including additional gem dependencies.
Jun 21, 2022
5 Easy to Miss Security Best Practices for Web Apps
Worrying about your app's quantum resistance is a perfectly legitimate concern. But, in this blog post, I'll take a step back and describe and few simple but easy-to-overlook security tips. In many cases, a single line of config can protect your web application from a range of attacks.
Jun 7, 2022
How I've made $50,000 Profit from a Side Project Anonymous Slack Bot
My side project Slack app Abot, has recently crossed a milestone of $50,000 in total profit. For the last two years, it has been running mostly on autopilot. In this post, I describe how I operate a profitable SAAS as a solo founder and how passive income has affected my career.
Apr 11, 2022
How to Create ERC20 Meme Token and Bootstrap Uniswap Liquidity
I've recently learned that taking investment advice from Hard Rock Nick is not always lucrative... In this blog post, I'll describe a step-by-step process for releasing an ERC20 meme token on the Ethereum network. By creating a token, you can better understand the inner workings of crypto scam schemes. And distinguish potentially genuine projects from outright scams. Additionally, we'll make our token tradeable by bootstrapping liquidity on permissionless AMM Uniswap contracts. I'll also demonstrate how to manipulate the initial capitalization so that you can instantly become a crypto millionaire.
Mar 31, 2022
Updated Jan 21, 2024
How to Run ETH 2.0 Geth Full Node on AWS EC2 with Nginx, SSL and WSS after the Merge
A full Ethereum node is often necessary for development purposes or if you don't want to rely on 3rd parties like Infura for blockchain access. Compared to the Ethereum killers, running a full ETH node is relatively affordable and requires only a basic dev ops skillset. In this blog post, I'll describe a step-by-step process to setup a full Geth node on AWS EC2. We'll discuss hardware costs and configure HTTPS NGNIX proxy for using Metamask wallet with your proprietary node. This tutorial covers Geth version 1.10.26, so it applies to ETH 2.0 protocol version after the Merge. I won't delve into details but focus on the necessary minimum to get your node up and running quickly.
Mar 23, 2022
Intro to Thread-Safety in Ruby on Rails
Ensuring thread safety is critical if you want to build a performant Rails app. Unfortunately, threading-related bugs are often sneaky and only manifest in highly concurrent production environments. In this blog post, we'll discuss code examples that are not thread-safe. I'll also describe a toolkit for debugging and discuss possible solutions. Developing an eye for spotting these errors before shipping to production can save you a lot of headaches.
Mar 1, 2022
The In-depth Guide to ActiveRecord load_async in Rails 7
Rails 7 introduces ActiveRecord load_async method that runs SQL queries asynchronously in the background thread. This seemingly simple change of just adding a single new method that takes no arguments has profound implications for database layer interactions. In this tutorial, we'll deep dive into the intricacies of this new load async API. We'll discuss lazy-loaded queries, Ruby threading model, blocking IO, database pool vs. max connections limit, and performance impact of concurrent database clients. I'll also try to suggest scenarios where introducing async SQL queries could have the most benefit without sacrificing the stability of your Rails app.
Feb 15, 2022
Ruby Quick Tip - Use Deep Fetch for Nested Hash Values
Hashes are the most common data structures in Ruby and Rails apps. In this tutorial, I'll describe a simple tip that makes working with hash values less prone to errors. It also improves code readability and provides a unified way of handling data structure issues.
Feb 8, 2022
Rails Quick Tip - Display Current Environment in Console Prompt
Am I the only programmer who once or twice messed up production by thinking it was development? In this short tutorial, I'll describe a simple way to reduce the risk of mixing up your current working Rails environment.
Feb 1, 2022
Updated Oct 18, 2023
Easy to Miss Way to Irreversibly Lose AWS S3 Data
Many web apps use AWS S3 buckets for storing static assets like PDFs and images. Unfortunately, the default config makes it just too easy to irreversibly lose all the data. For many projects, it would probably mean that all the team can pack their bags and go home. Read on if you want to find out how you can accidentally or maliciously obliterate S3 production data. We'll also learn how to safeguard your project from these tragic scenarios using replication backups to a secondary AWS bastion account.
Jan 18, 2022
Updated Mar 16, 2023
Five Easy to Miss PostgreSQL Query Performance Bottlenecks
PostgreSQL query planner is full of surprises, so a common-sense approach to writing performant queries is sometimes misleading. In this blog post, I'll describe examples of optimizing seemingly obvious queries with the help of EXPLAIN ANALYZE and Postgres metadata analysis.
Dec 8, 2021
Updated Dec 12, 2021
How to Spend Less Time on YouTube
Maybe I'm paranoid. But, I think there's a lot of smart people out there dedicating their life's work to make others keep watching videos. Since YouTube's incomprehensible decision to remove dislikes count it's become even easier to waste time on worthless content. In this blog post, I'll describe a simple trick that helped me start using YouTube in a more deliberate and focused manner.
Oct 5, 2021
Using Dynamic Config Variables in Ruby on Rails Apps
Config variables should never be embedded directly in the codebase. It is a common practice to extract them into a separate configuration layer. A standard approach for Ruby on Rails apps is to use static ENV variables that can only be changed via a release process. In this blog post, I'll describe the use cases for using dynamic config variables that can be modified on the fly. I'll also share a simple way to start using them in your app without including additional gem dependencies.
Sep 28, 2021
Hunting for Rare NFTs in the Ethereum Dark Forest
Ethereum mempool, a.k.a Dark Forest, is where most transactions are submitted before inclusion in the public blockchain. By analyzing its contents, you can react to pending transactions ahead of other bots and users. In this blog post, I'll describe how you can leverage mempool analysis to snipe rare NFT tokens before the gas wars break out.
Aug 31, 2021
Updated Mar 16, 2023
My Recipe for Optimizing Performance of Rails Applications
Rails performance audits and tuning have been my main occupation and source of income for over a year now. In this blog post, I'll share a few secrets of my trade. Read on if you want to learn how I approach optimizing an unknown codebase, what tools I use, and which fixes are usually most impactful. You can treat this post as a generalized roadmap for your DIY performance audit with multiple links to more in-depth resources.
Aug 24, 2021
5 Productivity Tips for Lazy Ethereum Blockchain Developers
Working with Ethereum blockchain is vastly different from any tech stack that I've encountered before. In this blog post, I'll describe a set of tools and techniques that I wish I knew when I started building my first Solidity project. We'll discuss how to use the Mainnet without paying gas fees, apply advanced debugging to local transactions and steal all the Vitalik's Ether.
Aug 17, 2021
asdf and Docker for Managing Local Development Dependencies
Have you ever updated a database for one project just to discover that you accidentally broke another? Ensuring the isolation between your local dependencies can save you hours of rolling back a breaking update or resolving intertwined dependencies. In this blog post, I describe how you can manage your local development stacks using Docker containers and asdf.
Jun 29, 2021
Updated Mar 7, 2022
Building Permanent and Uncensorable Blog with Ethereum ENS and IPFS
The internet nowadays is ephemeral. Layers upon layers of trusted 3rd parties are necessary to distribute content online. It requires ongoing maintenance and is susceptible to censorship or hostile takedowns. In this blog post, I describe the steps I took to host my blog in a trustless, permanent, and censorship-resistant way using the IPFS network and Ethereum blockchain.
Jun 8, 2021
Deploying My First Ethereum Smart Contract for Fun and Profit
I'm the kind of person that buys $500 worth of Dogecoin, and one day later, panic sells with a 30% loss. Recently, I've deployed my first Ethereum smart contract to help optimize this buy high, sell low investment strategy. Read on if you want to learn about my first steps in the ETH and blockchain ecosystem.
May 17, 2021
How to Monitor Sidekiq Process Uptime in Rails Apps
Things usually work until they don't. Sidekiq background job process can explode, quietly turn off, or get stuck for a variety of reasons. Random network errors, misconfigured email clients, shortage of RAM, or disk space on Redis to name a few. Adding a correct monitoring infrastructure can save you a lot of headaches and angry calls from customers. In this blog post, I'll describe a simple way to monitor the uptime and responsiveness of Sidekiq processes in Rails apps.
Apr 13, 2021
PostgreSQL EXPLAIN ANALYZE for Web Developers Part 1 - Indexes
Interpreting the output of SQL EXPLAIN ANALYZE might seem like dark magic at first. I'm starting a series of blog posts where I'll be well... explaining it based on common use cases from web applications. Read on if you've ever wanted to start using EXPLAIN ANALYZE for debugging slow PostgreSQL queries but did not manage to wrap your head around it. In the first part, we'll discuss how the PostgreSQL query planner decides whether to use an index.
Apr 6, 2021
4 Non-standard Ways to Fix N+1 SQL Queries in Rails
I'm not sure if the world needed another post about N+1 queries in Ruby on Rails. To make up for the cliche topic, I'll describe less common solutions to this problem. Read on if you want to learn how to reduce the number of cascading N+1 SQL queries without using includes or additional table join operations.
Mar 24, 2021
How to Improve GDPR Compliance for Web Apps using AWS
Your app must comply with GDPR (General Data Protection Regulation) even if you are not located in the EU. It is enough that you have European users. In this blog post, I'll describe eight ways to improve the GDPR compliance for your web app. Implementing the following techniques by itself will not make your app GDPR compliant. However, if you don't have them in place, it means that there's a severe loophole in your app's security and compliance.
Mar 8, 2021
How Blogging Changed My Programming Career
This is my 50th post published on this blog. To celebrate, I'll go all meta and describe the ins and outs of my blogger's career. Read on if you ever wanted to start writing but never got around to actually hitting the publish button. This post aims to encourage you that blogging can be loads of fun and open up a whole range of opportunities for your career.
Feb 22, 2021
Updated Mar 6, 2021
How to Avoid the Most Dangerous Word in Software Development
J-U-S-T. Those four characters can be significantly detrimental to a software development process. In this blog post, I’ll describe how the “just keyword” can affect team’s communication and how to avoid misusing it on Slack.
Feb 2, 2021
Updated Mar 7, 2021
UUID Primary Key in Elixir Phoenix with PostgreSQL and Ecto
UUID also known as GUID is an alternative primary key type for SQL databases. It offers some non-obvious advantages compared to standard integer-based keys. Phoenix provides reliable support for working with UUID using its Ecto PostgreSQL adapter. In this tutorial, we will dive deep into UUIDs with all their cons and pros.
Jan 26, 2021
Why it's Critical to add Secondary Backups for AWD RDS Database
AWS RDS is a cloud relational database. It's suitable for both early-stage startups and Web-Scale companies. One catch is that it’s possible to irreversibly loose all your data if you're using it. In this blog post, I'll describe why the default backup system offered by RDS is insecure and how to improve it.
Jan 5, 2021
Updated Dec 22, 2021
How to Free Disk Space on MacBook used for Development
Installing or updating an app (ahem, ahem XCode...) on macOS is sometimes surprisingly difficult because of missing disk space. In this blog post, I'll describe various ways to quickly and safely clean vast amounts of storage on a Mac Book used for web development.
Nov 10, 2020
Low Hanging Fruits in Frontend Performance Optimization
In this blog post, I describe the often-overlooked techniques that can significantly improve your web app's overall performance. These tips apply to all the web technologies like Ruby on Rails, NodeJS, Python Django, or Elixir Phoenix. It does not matter if you render an HTML or serve an API consumed by the JavaScript SPA framework. It all comes down to transferring bytes over the HTTP protocol. Frontend performance optimization is all about making this process as efficient as possible.
Nov 5, 2020
How to Setup Pi-hole on a Local Computer without Raspberry Pi
Pi-hole is an excellent tool for blocking advertisements and trackers in your local network. The typical setup is to install it on a separate Raspberry Pi and proxy your network traffic through it. If you don't have a Raspberry Pi or don't want to do a more involving setup, you can run Pi-hole on your local computer in a Docker container. Let me explain how to do it in this quick tutorial.
Oct 6, 2020
Updated Jun 12, 2022
Why You Should Migrate your Heroku Postgres Database to AWS RDS
Heroku PostgreSQL addon is excellent for a quick start setup of a new project. Once your web app matures, then migrating to an alternative database engine like Amazon RDS should be considered. In this blog post, I'll describe the benefits and drawbacks of using AWS RDS instead of the default Heroku addon. I'll also compare the pricing, available features, performance characteristics and explain why projects that care about EU GDRP compliance should avoid using the Heroku database.
Sep 28, 2020
Updated Dec 23, 2021
Tuning PostgreSQL Query Performance with PG Extras
PostgreSQL database queries are a common performance bottleneck for web apps. Before you resort to more complex optimization techniques like caching or read replicas, you should double-check if your database engine does not need tuning and queries are not underperforming. In this blog post, I present a step by step guide on using PG Extras library to spot and resolve common PostgreSQL database performance issues.
Aug 4, 2020
How to Improve ActiveRecord Query Performance with Subquery Caching
Slow database queries are a common performance bottleneck for Ruby on Rails apps. Simplifying a complex query is often not possible due to the underlying business logic. Instead, you can extract parts of a query, cache and reuse them to improve performance. In this tutorial, I'll describe a range of techniques on how to do it.
Jun 23, 2020
Postgres Indexes for ActiveRecord Join Tables in Rails Apps
Join tables are a common citizen in Ruby on Rails apps. Their use case is to provide many to many relation between database models. Adding correct Postgres indexes on join tables is not obvious. I've noticed that some tutorials, Stack Overflow posts, and even Rails itself provide incorrect advice on how to do it. In this tutorial, we'll look into how compound Postgresql indexes work and how to correctly use them with join tables.
May 26, 2020
Brotli and Gzip Compression for Assets and JSON API in Rails
HTTP content compression has a significant impact on the client-side performance of a web app. In this blog post, I'll describe different methods for compressing dynamic and static content in Ruby on Rails apps using Gzip and Brotli algorithms.
Apr 21, 2020
Updated Jun 1, 2020
Secure EC2 SSH Access for Dynamic IP with Ephemeral Security Groups
Leaving inbound EC2 SSH ports open greatly increases the risk of unauthorized entities running commands on the server. In the perfect world, each developer with access rights would use only a single static IP address. You could whitelist it in an AWS security group in addition to using standard SSH keys based authentication.
Mar 19, 2020
How I Fight my Internet and Mobile Addiction
Mindlessly checking social networks, watching YouTube, and permanently distracted by push notifications. Have you been there? In my least technical post so far, I'm going to share a couple of tips on tackling the internet and smartphone addiction.
Feb 25, 2020
4 Ruby on Rails Mistakes that could Kill Your Production Servers
In this tutorial, I’ll describe a couple of non-obvious Ruby on Rails mistakes that could bring down your production system. They are so sneaky that they could get past the review process of even more experienced developers. Please don't ask me how I know them.
Jan 28, 2020
Concurrency for HTTP Requests in Ruby and Rails
Ruby MRI does not support parallel CPU bound operations due to the dependency on non-thread safe C extensions. Input/Output operations like HTTP requests, are still a perfectly valid use case for spinning up multiple threads. Read on to learn what tools are available for requests concurrency in Ruby with all their cons and pros.
Jan 7, 2020
Inheritance and Abstract Class Pattern for Ruby on Rails Controllers
Inheritance is often frowned upon, because of the banana and jungle metaphor. In some scenarios, it can be a viable alternative to modules composition for sharing behavior. In this tutorial, I will describe a practical use case where using abstract base class pattern plays well with Ruby on Rails controllers layer.
Nov 26, 2019
Updated Mar 6, 2021
UUID Primary Key in Rails 6 with PostgreSQL and Active Record
UUID also known as GUID is an alternative primary key type for SQL databases. It offers some non-obvious advantages compared to standard integer-based keys. Rails 6 release fresh out of beta introduces a new feature in ActiveRecord that makes working with UUID primary keys more straightforward. In this tutorial, we will dive deep into UUIDs with all their cons and pros.
Sep 24, 2019
Getting Started with AWS S3 IAM Policies Security Config for Rails Apps
Storing files on S3 is for many developers, the first contact with AWS cloud. Unfortunately, the quick and easy configuration can be insecure. If you are uploading files to an S3 bucket but never configured a custom AWS IAM policy it's possible that there's a security issue in your app. In this tutorial, I will describe what IAM policies are and how to securely configure them when working with S3 in the Rails apps.
Aug 12, 2019
The Road to $10,000 Profit from my Side Project Slack Bot
My side project Slack app Abot has recently reached a milestone of $10,000 total profit. In this blog post, I describe how the project has changed during the last year and what I am doing to grow and promote it. I also share some details about the usage stats and revenue.
Jul 9, 2019
Updated Jul 14, 2020
A Simple Way to Encrypt Data in Rails without Gem
Storing sensitive data in plaintext can seriously harm your internet business if an attacker gets hold of the database. Encrypting data is also a GDPR friendly best practice. In this blog post I describe a simple way to securely encrypt, store and decrypt data using built in Ruby on Rails helpers instead of external dependencies.
Jun 26, 2019
Updated May 12, 2020
How to Backup Heroku Postgres Database to an Encrypted AWS S3 Bucket
Heroku offers a robust backups system for it's Postgres database plugin. Unfortunately, you can irreversibly lose all your data and backups just by typing a single command. It might seem improbable, but still, I would rather not bet my startup's existence on a single faulty bash line. In this tutorial, I will describe how to set up a proprietary redundant Heroku PostgreSQL backups system to a secure AWS S3 bucket.
May 19, 2019
Updated Jul 19, 2020
Best SEO Tips & Tools for Blogging Programmers in 2020
I've noticed that many programming blogs I read don't implement certain simple SEO techniques, and bloggers could be missing valuable traffic opportunities. I will describe a couple of search engine optimization tips which can improve your technical blog's SEO ranking and search results position in 2020. I will cover topics like Google's Featured Snippets, best rendering speed tips and social media meta tags.
May 14, 2019
Updated Jun 28, 2019
Continuous Integration and Deployment for Rails using CircleCI
Continuous integration and delivery pipeline can have a significant impact on the dev team's productivity and stability of production releases. In this tutorial, I describe how to automate testing, security checks, and deployments for Ruby on Rails apps using CircleCI. I cover a basic CI setup as well as more advanced features like concurrent specs, dependencies caching, NodeJS/Webpack setup, Heroku deployments, and GitHub integration.
Apr 17, 2019
Updated Jun 28, 2019
Rails ActiveRecord PostgreSQL Foreign Keys and Data Integrity
Most Ruby developers work with Rails and Active Record for PostgreSQL database interactions. It provides a ton of magic and is simple to start with. Data integrity problems start creeping up once the code base and database structure gets older. In this blog post, I will describe a couple of techniques for ensuring data integrity and validation in Ruby on Rails web apps. We'll cover adding foreign keys, database level validations and more.
Apr 15, 2019
Updated Jun 28, 2019
Screencast - Sublime Text Mouse-Free Development Advanced Productivity Tips
Sublime Text is my editor of choice for developing Ruby on Rails and JavaScript web apps. In this screencast, I present a couple of more advanced productivity tips and configs that let you minimize the usage of mouse during development.
Jan 7, 2019
Updated Jun 28, 2019
Active Admin Gem Tips and Performance Tuning for Rails Apps
Active Admin gem is a popular tool for building admin interfaces in Ruby on Rails apps. In this tutorial, I will describe a couple of less obvious tips and performance tuning techniques.
Sep 12, 2018
Updated Jun 28, 2019
Optimize Dokku Deployment Speed for Ruby on Rails with Dockerfile
Dokku lets you setup Rails hosting infrastructure on a simple VPS without much dev ops experience. Although it is easy to get started, a default config might result in very slow and unreliable deployments. In this blog post, I will describe how I've improved my Dokku based Ruby on Rails (NodeJS with Yarn and Webpack) application deployment speed by over 400% using a Docker image Dockerfile.
Jul 9, 2018
Screencast - Showcase of Focus Board, Visual Web Scraper Prototype
In this screencast, I present a prototype of my new side project. It is a simple tool that allows you to visually scrape interesting parts of different websites to create your personal internet dashboard. I want to probe the interest before releasing a public MVP version.
Jun 28, 2018
Updated Jun 28, 2019
Remove AMP and don’t Affect SEO Rating, Organic Traffic, Performance
I've used to recommend supporting Google AMP pages as a reliable way to increase site SEO rating, organic traffic and performance. Recently I've removed AMP from my website. In this blog post, I will describe how it affected my blog and a couple of more advanced web performance optimization techniques I am using instead of a proprietary standard like Accelerated Mobile Pages.
Jun 4, 2018
Updated May 17, 2020
Setup ELK for NGINX logs with Elasticsearch, Logstash, and Kibana
ELK Elastic stack is a popular open-source solution for analyzing weblogs. In this tutorial, I describe how to setup Elasticsearch, Logstash and Kibana on a barebones VPS to analyze NGINX access logs. I don't dwell on details but instead focus on things you need to get up and running with ELK-powered log analysis quickly.
May 23, 2018
Screencast - How to Write and Promote a Programming Blog Post
In this screencast, I explain how to write, release and promote a programming blog post on various social platforms even if you don't have an audience yet. I present my typical routine and tools I use when submitting a new post.
May 21, 2018
Hosting Static Site on Dokku with Free Cloudflare CDN and SSL
Dokku is dev ops for dummies and a simple way to deploy websites on a barebones VPS. In this tutorial I will describe how to use it to host a static site, and setup global assets caching with free Cloudflare CDN and SSL certificate.
May 14, 2018
Adding GDPR Compliance to My Rails App and Technical Blog
New data privacy GDPR EU regulations are going live in less than two weeks. In this blog post, I will describe actions I took to add GDPR compliance to my Ruby on Rails SAAS app and this blog itself.
May 7, 2018
Screencast - My Ruby on Rails IDE editor Workflow, Productivity Tips and Tools
In this screencast, I implement an improvement to subscription payments handling in my side project Abot. I show my typical Ruby on Rails IDE workflow, productivity tools, and techniques.
May 2, 2018
Updated Jun 28, 2019
Quick Tip - Boost Your Productivity with Ruby on Rails Console Aliases
Recently I've started using a productivity technique which saves me a lot of unnecessary typing when working with Rails apps. In might seem trivial but I still wanted to share it because it makes my everyday work easier.
Apr 23, 2018
Updated May 31, 2020
Direct, Secure Rails Client-side File Uploads to AWS S3 Buckets
Many Ruby on Rails apps use Amazon AWS S3 buckets for storing assets. When dealing with files uploaded by front-end web or mobile clients there are many factors you should consider to make the whole process secure and performant. In this blog post, I will describe common pitfalls and an optimal solution when it comes to handling client-side file uploads.
Apr 9, 2018
Updated Nov 24, 2022
How to Migrate a Ruby on Rails App from Heroku to Dokku
Dokku is dev ops for dummies and a cheaper alternative to Heroku. Recently I've migrated a couple of my projects to it. In this blog post, I will describe how to setup and migrate a Rails app to Dokku with PostgreSQL, Sidekiq, Redis and Let's Encrypt or Cloudflare for free SSL.
Apr 2, 2018
Updated Jun 28, 2019
How Getting Featured by Hacker News Affected my Passive Income
Two weeks ago my blog post made it to the top of Hacker News. Around 30k people read about my side project Slack bot that day. In this blog post I will describe how it affected the project and my other passive monetization and marketing strategies.
Mar 19, 2018
Updated Apr 28, 2019
How I've Built a Profitable Slack App as a Side Project in Rails
I've built a Slack anonymous messaging bot in Ruby on Rails and it is profitable. In this blog post I will describe what I did and tools I used to create, promote and monetize a simple SAAS product.
Mar 12, 2018
Updated Mar 17, 2023
Track Down and Fix Slow ActiveRecord SQL Query Performance in Rails
Scaling issues are great because it means that you have traffic on your website. Before you decide that 'Rails doesn't scale!' and start a rewrite to a tech stack with potentially more performance, maybe you should double check queries that your PostgreSQL database executes. Below I describe some tools and techniques you can use to track down, diagnose and optimize slow Active Record SQL query execution.
Mar 5, 2018
Updated Aug 11, 2020
Practical Differences between Working in Ruby and iOS
Developing iOS mobile apps and server-based Ruby applications is different on many levels. In this blog post, I will present a high-level overview of different aspects of day-to-day working in these technologies.
Feb 26, 2018
Updated May 31, 2020
Serious SEO Mistake of Many Startups and Software Houses
Many software houses and startups are blogging regularly. A simple blog implementation detail can seriously hurt company's SEO rating and in consequence business. Read on if you are interested what’s the problem and how it can be fixed.
Feb 20, 2018
Updated May 24, 2020
Stop Blogging on Medium if You Care about SEO
Medium is an extremely popular blogging platform for both newcomers and expert tech-savvy bloggers. I've noticed the serious SEO related issue with using it as your main blogging tool. Read on if you are curious how Medium hurts your internet brand and what's the alternative. We'll discuss how nofollow and dofollow links work and what kind of links Medium uses.
Feb 12, 2018
Updated Jun 28, 2019
Ruby on Rails Simple Service Objects and Testing in Isolation
Service Objects are not a silver bullet but they can take you a long way in modeling your Ruby on Rails app's domain logic. In this blog post, I will describe how I usually work with service object pattern in a structured way. I will also cover a simple testing in isolation with mocked services layer.
Feb 5, 2018
Updated Jun 28, 2019
Optimize Rails Performance with Redis Caching and Rack Middleware
According to (a bit exaggerated) Pareto principle, 5% of your Rails app endpoints could account for 95% of performance issues. In this blog post I will describe how I improved a performance of my Rails application’s bottleneck endpoint by over 500% using a simple Redis caching technique and a custom Rack middleware.
Jan 29, 2018
Updated Jun 28, 2019
Simple SSL Proxy for Insecure Browser Content with Ruby or NGINX
SSL protection is becoming de facto standard in web and mobile development. One potential problem is that website could be served via a secure SSL connection and still displayed as insecure by most of the modern browsers. It's enough that at least one of its resources is served without SSL. In this blog post, I will explain how to setup a simple Ruby and NGINX server to work as an SSL proxy for insecure content and describe some basic streaming techniques.
Jan 22, 2018
Updated Jun 28, 2019
Multiple Domains with Free Wildcard SSL from Cloudflare
Domain names you own could be your most expensive to do list. What’s more a domain without a valid SSL will show up in all modern browsers as an insecure content. In this tutorial, I will explain how to minimize the cost of owning multiple wildcard SSL-protected domains using Cloudflare and set them up with Github Pages, Heroku or NGINX.
Jan 15, 2018
Updated Apr 26, 2023
Reduce Rails Memory Usage, Fix Leaks, R14 and Save Money on Heroku
In theory, you can run both Rails web server and Sidekiq process on one 512mb Heroku dyno. For side projects with small traffic, saving $7/month always comes in handy. Unfortunately when trying to fit two Ruby processes on one dyno you can run into memory issues, leaks and R14 quota exceeded errors. In this post, I will explain how you can limit memory usage in Rails apps.
Jan 8, 2018
Updated Jun 28, 2019
Productive Laziness - Optimize your Shell Workflow
I would like to share a simple productivity tip that probably helped me save thousands of keystrokes so far. I’ve been using this technique for a while now to maximize my laziness (productivity) during work and so, recently I wrapped it up in an easy to use Ruby Gem.