1. React Hooks Not to Run on Initial Load

    There are times that a page would error out if on initial load, it renders more than once. Rendering more than once unnecessarily is always a waste of resource and loading time, but in some occasion, the page stops loading if there are more than one initial load. For example,…

  2. Extending build-in ruby classes in Rails

    It's a useful skill to extend build-in ruby classes in Rails. And it turns out to be fairly straightforward. We're going to use an example to explain how to do that. Use case: we have an array of scheduled jobs, work orders and events. We'…

  3. Sidekiq Server Side Middleware

    Our team recently has converted all our background jobs from delayed job to Sidekiq. There are many things that we have learned along the way. One of the useful tools is to utilize sidekiq middleware to manipulate the job when pushing the job to a redis server or right before…

  4. Sidekiq WebUI Access Control

    Sidekiq built-in webui is simple and useful. We would like to take the advantage of that instead of reinventing the wheel. Sidekiq recommends for a bare Rack app, a session middleware before Sidekiq::Web in config/routes.rb should be used (reference [https://github.com/mperham/sidekiq/blob/main/Changes.…

  5. Write Ng Add Schematics for Library in Monorepo

    In our monorepo, we have about 30-40 projects under library. We use custom schematics to integrate our library with Angular CLI. This post shows how we create schematic for ng add to enhance the initial installation process for our consumers. Our initial workspace/library structure is shown as: /<workspace&…

  6. Specs and CodeCoverage for Monorepos

    We recently switched our many in house Angular repos to a Monorepo. There are tons of benefits that are widely acknowledged and we won't repeat them here. The main idea of this post is to show how we reorganized our specs to avoid circular dependency issues during build.…