This post outlines the use of Google’s diff-match-patch library to generate patches that can be translated to operations against an AutoMerge.Text CRDT for situations when deriving the operations directly from user interactions is cumbersome.
Continue reading Integrating Google diff-match-patch with AutoMerge.Text
It is fairly straightforward to add a GraphQL API powered by Apollo Server to a Next.js application through a koa middleware.
The abbreviated snippet below summarizes the setup along with the libraries involved:
Continue reading Integrating Next.js, Apollo Server and Koa
This post is intended to primarily benefit people coming from other, so called “modern” editors to Emacs. Emacs veterans are likely to find most of the tips here very elementary.
I have observed that many programmers habituated to newer editors have many implicit assumptions about editing workflows which simply don’t hold true within Emacs environment and this prevents them from being productive to the fullest extent.
This post primarily focusses on how getting familiar with the concept of
regions in Emacs can result in productive workflows. These concepts, coupled with a few extensions can enable much more pleasurable code-editing workflows not easily achievable in more prevalent “modern” editors.
Continue reading Getting productive with selection and navigation in Emacs
While this post primarily compares Reason and TypeScript, much of what is outlined about TypeScript equally applies to flow as well.
Continue reading ReasonML vs TypeScript – First impressions
Typescript team has explicitly stated that they don’t intend to extend typescript’s static type checking to the runtime.
Typescript Design Goals lists the following in the section on Non-goals:
Add or rely on run-time type information in programs, or emit different code based on the results of the type system. Instead, encourage programming patterns that do not require run-time metadata.
However, this also implies that for cases when static typing cannot help us we need to separately write validators using a validation library (eg. Joi) which has to be kept in sync with the typescript types.
This post outlines an approach to eliminate this redundancy using the io-ts library by Giulio Canti. This approach has also been adopted by some other libraries like MobX State Tree and Runtypes.
Continue reading Typescript and validations at runtime boundaries
Predictability and Side-effects
Redux advertises itself as a predictable state container.
This predictability comes at a cost: Your actions that are supposed to manipulate the state of your application are processed synchronously through pure functions called reducers. You should not have side-effects in your reducers.
An introductory tutorial on making event scheduling management more accessible and configurable to administrators through database driven admin interfaces in Rails.
Eliminate full page refreshes and reduce page transition latency, in your your Rails sites, using SPF.js – a library for dynamic page updates from Youtube.
While emacs is well known to be a very productive editor, there are a few additional steps one must take to set it up as a development environment for Ruby on Rails. This post outlines my current setup.