Topics

All posts

Convert a ViolentMonkey script to a Chrome extension

Convert a ViolentMonkey script to a Chrome extension

The script I created in Course/movie labeling solution using Firebase and ViolentMonkey worked well on one page but randomly failed to work in another. It was caused by the page’s JavaScript code which altered the behavior of XMLHttpRequest. Because I was not able to resolve it, I decided to convert my script into a Chrome extension, which would be executed in an isolated environment.

Read More Read More

Custom build script in Node.js

Custom build script in Node.js

For simple build tasks in Node.js I use a custom script. Let’s consider the following requirements:

  1. Create the dist and dist/assets folders.
  2. Concatenate several JavaScript files and save to dist/background-dist.js.
  3. Copy assets/*.png files to dist/assets/.
  4. Copy several other files.

Read More Read More

Course/movie labeling solution using Firebase and ViolentMonkey

Course/movie labeling solution using Firebase and ViolentMonkey

There are pages that do not show information about items you watched, want to watch or don’t want to. May it be a movie database, TV guide, list of online courses, and so on. One such page is Highbrow which, for an unknown reason, has no account feature yet lists a lot of courses. It may be easy to forget which you completed and even harder to find a new course to start.

I’ll show how to create a kind of addon – a GreaseMonkey/ViolentMonkey script that will be run automatically once you enter that page (here: Highbrow) and show the items you marked as completed or todo. That script will connect with a free cloud database Google Firebase to store your list and provide an easy ability to mark every course. Here it is in action:

Read More Read More

Configure Angular CLI to use tabs instead of spaces

Configure Angular CLI to use tabs instead of spaces

As a tab indentation enthusiast, I wanted to use an Angular project with tabs instead of 2 spaces. Unfortunately, there are several settings to change, and the schematics used by ng CLI command supports only spaces. Despite numerous requests (e.g. here and here), Google did not decide to introduce an option to set indentation for generated files. I went through the process of making Angular project tabbed and I’ll describe it here.

Read More Read More

Windows boot & disk repairing toolkit

Windows boot & disk repairing toolkit

Recently I had the doubtful pleasure of trying to fix a blue screen in my Windows laptop. I learned a lot, tried tens of scenarios, but nonetheless I failed to repair it. This post contains a list of the tools I used to recover the system and some hints on how to deal with various problems. I will try to answer the following questions:

What is MBR and GPT? How to rebuild BCD and fix MBR? How to clone a partition or disk to another disk or file? How to remove and create partitions? How to remove Windows Update leftovers?

Read More Read More

Automatically enhance headers with hierarchy, links and smooth scrolling with offset

Automatically enhance headers with hierarchy, links and smooth scrolling with offset

There are several things useful in a longer document:

  • showing position of given heading in the structure
  • ability to create links to a heading
  • smooth scrolling to internal links
  • offset for scrolling if the top header covers some of the contents

Read More Read More

Excel / LibreOffice Calc – text and data processing

Excel / LibreOffice Calc – text and data processing

I’ll show how to parse text, extract numbers and calculate averages on an example of performance data. I have performed a dozen of performance scenarios, each repeated four times to get an average. Every sample contained three values: time in seconds of execution of the first step, time in seconds of execution of the second step, and memory consumption in MB. For instance, 17.6 | 7.4 | 687 meant:

Read More Read More