Category: Programming

Github Copilot hyped IntelliSense or revolutionary pair programming

Somewhat of a month back I applied for GitHub copilot access, out of curiosity and I am using it since I got access around 11 June 2021. To apply for access you basically submit an application form, and after it’s reviewed you get an invite to a private GitHub repo, once you have access to that repo you can use copilot by using the VS extension and authenticate with the Github account that has access to that repo, be sure to change fast the issues watching level because it’s set to all and that will basically flood your email address with thousands of emails since it’s a very popular repo. View full article

Flask PyWebCamWebMonitor Web App

A couple months ago I made a Python-Vue app ( Flask PyWebCamWebMonitor ) for controlling webcams(live view/record/stream) attached to a Linux host.

It’s pretty straight forward you use pip3 to install it then you install it as a system service or you start it manually with a command that is registered on the system automatically after you installed the python package.

When I first released it I tested it on a Linux X86 host but my intention was to make the app work even on the smallest dev boards, so a few days ago I tried to install it on orange pi zero.

As expected I encountered some problems first, the problem is that installing NumPy which is a dependency of OpenCV which is a dependency of my app, was complicated because the NumPy was not available for arm devices and when you tried to install it from building it you ran out of memory and the kernel killed the building process, you can activate a swap, and increase your /tmp size to overcome these limitations but it is simple just to install NumPy from the APT repo with apt install python3-NumPy, that you don’t have to needlessly wait. View full article

Async Task without Queue or E-loop PHP

Most react-PHP code I’ve seen in the open that is not extension-based (doesn’t extend the PHP core language) uses some kind Event-Loop, something similar to how many technologies or languages(I.e. JavaScript) implement concurrency that doesn’t support threads.

And historically on single-core CPU’s threads practically transformed into loops underneath. But the main idea is that in many languages, an async behavior is very easily achieved, maybe you need a keyword, maybe you need a special class, but in general, it is simple.

Now if you want the easiest way to do something asynchronous in PHP it will be a little costly, you can do that by spawning a new PHP process directly from PHP. View full article

The new native-lazy load Vue Component

So since April 2020 we have a browser native support to do lazy loading of images which is great, so i decided to write a quick Vue component that uses that functionality.

One problem with the lazy native loading is that it won’t display any loading indicator when the image loads.

At the moment only Firefox and Chromium(also Android) based browsers are supporting this feature but it behaves very differently, in Chromium-based browsers it loads far from the end of the viewpoint (a very eager lazy loading) and in Firefox (the image will load only when it enters into the viewport by a lot like 5% or 10% of the IMG element). View full article