Skip to content

Instantly share code, notes, and snippets.

View PrashantDhungana's full-sized avatar
🚀
Levelling Up ⬆

Prashant Sharma Dhungana PrashantDhungana

🚀
Levelling Up ⬆
View GitHub Profile
@PrashantDhungana
PrashantDhungana / update-git-author.sh
Created May 9, 2025 13:02
Bash Script to Update Git Commit History - Change Author and Committer Information
# This script updates author and committer information for past Git commits.
# It modifies commit history where the specified OLD_EMAIL is found,
# replacing it with the CORRECT_NAME and CORRECT_EMAIL.
# 🔥 Why Use This Script?
# - Correct misattributed commits after email address changes.
# - Update author information across all branches and tags.
# - Maintain consistency in commit history before sharing a project.
# 📦 How It Works:
@tertek
tertek / pcov-code-coverage-windows.md
Last active January 7, 2025 05:33
PHPUnit Code-Coverage with PCOV on Windows (Local Development Environment)

PHPUnit Code-Coverage with PCOV on Windows

Download and Install PCOV

  1. Download latest release (currently 1.0.11) for Windows for your version of PHP and the correct format (ts or nts) from PECL
  2. Unzip downloaded package and copy the files php_pcov.dll and php_pcov.pdb to your PHP extensions directory, e.g. C:\bin\php\php-7.4.27-Win32-vc15-x64\ext\
  3. Modify your php.ini so that PCOV is loaded. Therefore add extension=pcov:
..
extension=fileinfo
extension=gd2
@joepie91
joepie91 / .md
Last active March 7, 2025 22:07
Prefix codes (explained simply)

A "prefix code" is a type of encoding mechanism ("code"). For something to be a prefix code, the entire set of possible encoded values ("codewords") must not contain any values that start with any other value in the set.

For example: [3, 11, 22] is a prefix code, because none of the values start with ("have a prefix of") any of the other values. However, [1, 12, 33] is not a prefix code, because one of the values (12) starts with another of the values (1).

Prefix codes are useful because, if you have a complete and accurate sequence of values, you can pick out each value without needing to know where one value starts and ends.

For example, let's say we have the following codewords: [1, 2, 33, 34, 50, 61]. And let's say that the sequence of numbers we've received looks like this:

1611333425012