Category Programming

Semi-open Github Repos

If you ever had a repo and didn't want to set it completely open, then you didn't have many choices. For example, Gitlab at least lets you have a public repo with private code, but this isn't a thing for Github.

So I thought of a simple system where you have a bot that watches specific repos, and if a user stars one of those repos, then the bot will automatically invite that user to the private repo associated with the starred repo by a map.

You can take a look if you want on GitHub. The code for ...

View full article

Example of Language System in an Ionic 3 Application

When you want to create a language system and add multiple languages to your Ionic APP you have various designs available, but in a simple APP, there are 2 major ones.

The first design is where the UI design and APP functionality remain the same for both languages, in this case, you can use some javascript objects for every component you have.
This design is suited when you want to have consistency and implies a bit less work.

The second option is to clone each of your components for every langu...

View full article

C++ Windows Detect If MBR or GPT PartitionStyle Simple Example

As the title suggest this is a Windows-only example, you may notice that I used it in QT environment from qDebug() helper function, honestly, the only small project that I can think of for this function is one where you would like to change the bootloader, but as I said this is a trivial example.

A few remarks:

  • 1 CreateFile needs to be called from a process that was run as admin in order to work ( require admin in manifest )
  • 2 On MBR Fist sector/boot sector is always writeable
  • 3 L"\\\\.\\PHYSI...
View full article

Shred Function Qt C++ on windows

So, I searched for such a function and, I did find some things on O-Stack, but I rewrote what I found because it didn't actually work, I tested this function and it works pretty well, I think it has room for improvement as usual but I thought to share it anyway.

So here it is:

bool QtClAct::shred(const QString & fileName, uint RepeatWrite, bool DeleteFileLink) { if(RepeatWrite < 1) RepeatWrite = 1; QSaveFile file(fileName); QFileInfo fi(file.fileName()); for(int i=0; i < Repea...
View full article