Enhancing code efficiency and readability in code development
Installing MySQL Workbench using an elevated command prompt on Windows
Installing software on a Windows machine can sometimes require elevated privileges, especially when making changes to system-wide settings or configurations. One example is the MySQL Workbench, a widely-used tool for managing MySQL databases. In this article, we’ll walk through how to install MySQL Workbench using an elevated command prompt, rather than installing it directly through the graphical interface.
Counting term occurrences in JSON arrays using regex in VS Code
Working on a project where the JSON dataset contains over 460,000 named records, we are preparing to upsert these records into Pinecone. However, for validation and testing purposes, it's essential to cross-check how many times a specific term appears across the dataset. To ensure data integrity, we only want to include one record per occurrence, regardless of whether the term appears once or multiple times within a record.
How to search for specific 'SBT' occurrences in VS Code using regular expressions
If you're working with a large codebase in Visual Studio Code (VS Code) and need to find specific occurrences of a term, but only when it's a standalone word possibly surrounded by spaces or parentheses, regular expressions (regex) are your best friend. This guide will walk you through the steps to efficiently search for these instances, I'll be searching for the term 'SBT' and ensuring you don't pick up unwanted matches like `'ADSBTCR'` or `'SBT123'`.
git remove files from being tracked
How do you remove a file from git?
Use the command (rm) to remove files from your local git repository
git rm --cached
It's important to note the --cached flag deletes the file from your git repository, it becomes an untracked file in your project folder. For the change(s) to kick in, you need to commit the changes.
How to move your Git repo to another location
Moving a Git repo due to a change of agencies
Steps to change the repo:
1. Create a temporary directory
Create a temporary directory obviously where your other sites are located locally. For me, this is in the Sites directory.
mkdir temp-dir
2. Clone
Begin by cloning the current repo in the directory generated above
What the following git commands do...
git reset, git revert, and git cherry-pick are three Git commands used for different purposes related to managing your version control history. Here's a brief overview of each command:
git reset
git revert
git cherry-pick