Build a web page scraping and testing service using GraphQL and Playwright.

Photo by Frank Albrecht on Unsplash

Overview

In my previous article, I walked through with you on developing serverless APIs to test web pages under different resolutions using Puppeteer. In this article let’s use Playwright, which is a similar library to perform web browser automation.

Playwright is a library available in Node.js, Python, and Java to automate Chromium, Firefox, and WebKit with a single API. It is built to enable cross-browser web automation that is ever-green, capable, reliable, and fast.

Setup

Install Playwright

Let’s install Playwright and browser binaries for Chromium, Firefox, and WebKit. Playwright requires Python 3.7+.


Use Flask AppBuilder to develop CRUD REST APIs.

Flask API Development

Overview

For Python, when it comes to API development, we have an abundance of choices. Popular ones are Django, Flask, and FastAPI, to name a few.

In this article, let’s use Flask to build RESTful APIs to create, read, update and delete (CRUD) records in a database table. Specifically, I will use Flask + Flask AppBuilder to build the APIs in 5 minutes.

Setup

Libraries

Let’s install the flask-appbuilder library. I also installpython-dotenv in order to use a .env file as my configuration file.

$ pip install flask-appbuilder python-dotenv

Using a virtualenv will be preferred…


Using Vim/Neovim to manage your notes and to-do list.

Photo by Cathryn Lavery on Unsplash

Overview

Comparing to Vim/Neovim, one of the great features of Emacs is Org Mode. Org Mode is for keeping notes, maintaining to-do lists, planning projects, authoring documents, computational notebooks, literate programming, and more — in a fast and effective plain-text system.

In this article let’s go through the available options for Vim/Neovim for taking notes and managing to-do lists.

VimWiki

This is one of the most popular options we have for Vim/Neovim. Combining this withglow.nvim which I mentioned in my previous article makes writing a Markdown document extremely easy.

With VimWiki, you can:


New Neovim plugins to improve development workflow and productivity.

Neovim Plugins

Overview

In previous articles, I talked about Vim/Neovim plugins to help you code faster, and some of the niche Neovim plugins. In this article let’s go through new Neovim plugins that can improve your development workflow and productivity.

glow.nvim

As a developer, we normally need to write documentation in Markdown.

glow.nvim uses glow to directly render Markdown in Neovim buffer. Compared to other plugins which leverage browser, this plugin is definitely more convenient.


Text to image using Jupyter Notebook on Google Colab.

Overview

In one of my articles, I went through code examples on image classification using CLIP and ResNext. In this article let’s go through a few algorithms and libraries which can be used to generate an image from text.

CLIP + BigGAN

This library uses OpenAI’s CLIP and the generator from a BigGAN to generate images from text.

  • From Colab, open this notebook.
  • I use 100 iterations and 5 epochs to reduce the time to generate the image.

And this is the image generated for the phrase “flying cartoon elephant”.

Generated Image by Big Sleep

CLIP + Siren

This library uses OpenAI’s CLIP


Managing project-specific settings for Vim/Neovim projects.

Photo by Octavian Dan on Unsplash

Overview

I talked about managing multiple databases and projects in my previous articles. On some occasions, you may have a need to manage multiple projects with configurations only specific to the projects.

In this article, let’s explore the available options we have in Vim/Neovim. I will start with the simplest solution and then move on to explore plugins we can use.

exrc, vimrc, nvimrc

If you set the exrc option in your .vimrc or init.vim file, Vim/Neovim will execute .exrc (for both Vim/Neovim), .vimrc (Vim), .nvimrc (Neovim) found in the current directory when Vim/Neovim is started.

set exrc


Additional features to enhance your LSP experience in Neovim.

Neovim — Enhanced LSP Experience

Overview

In the previous article, I walked through with you how to set up LSP and DAP in Neovim. In this article let’s enhance the LSP experience in Neovim by configuring and setting up additional features.

Installation of Language Servers

Just like the previous article, let’s get started by installing the language servers.

If you are using coc.nvim, normally the language server is installed automatically for you. For Neovim LSP, there are available plugins to automate this process. Here I will go through the manual installation steps.

Python

For Python, let’s install pyright.

$ npm install -g…


Managing databases and run SQL statements, all within Vim/Neovim.

Photo by Caspar Camille Rubin on Unsplash

Overview

In my previous article, I walked through with you how to manage multiple projects within Vim/Neovim. In this article let’s extend this to see how to manage multiple databases.

Setup

I am going to use PostgreSQL and MySQL as examples. For this to work, on the client machine you will need to install the database clients.


Yes, you can play games in Emacs!

Photo by JESHOOTS.COM on Unsplash

Overview

Continue from my previous article where I walked through with you on setting up LSP and DAP for Emacs, in this article let’s explore gaming in Emacs for amusement and relaxation after a hard day of coding, all within Emacs.

Built-in Games

Tetris

  • Command: M-x tetris
  • Instructions: C-h m

Python application for real time object detection and segmentation.

Photo by Cory Schadt on Unsplash

Overview

In previous article I walked through with you on using YOLOv5 for real time object detection. In this article let’s develop a Python application for real time object detection using Detectron2, which is a Facebook AI Research’s next generation software system that implements state-of-the-art object detection algorithms.

The Application

The application uses opencv-python and Detectron2 pre-trained model to capture camera images and try to detect the objects.

  • Git clone the repository.
  • Run python setup.py install
  • Install Detectron2 based on Python version and GPU availability
  • Type d2 to start the application
  • Type q to…

alpha2phi

Programmer and occasional blogger.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store