How to remove files with “No Content Changes Found” in Git Desktop

Git desktop clients such as GitHub Desktop sometimes list dozens or hundreds of files as changed, but when you click one, there’s no diff, only “No Content Changes Found”. It typically happens after copying a project between Windows and Linux or macOS, unzipping a backup, or running a chmod over the whole folder. Git has noticed something about the files that changed, just not the text you see in them. ...

May 8, 2019 · 4 min · Harshvardhan Malpani

Mouse and Keyboard sharing across Computers

We use multiple computers in workspace or in home. Often need to share same mouse and keyboard for all because you probably have a wireless/wired keyboard mouse set. here arises the issue that how to share same set of input controllers for both machines. Below are a few free and paid options for you to choose from. They all work as expected when computers are connected via LAN or WiFi ...

May 5, 2019 · 2 min · Harshvardhan Malpani

Magento 2 Multi Select click all code – Tax Rates

When you create or edit a tax rule in Magento 2 (Stores > Tax Rules), you pick its tax rates from a scrolling list of checkboxes. If you’ve imported hundreds of rates, ticking every one of them by hand takes ages. This snippet ticks them all for you. Open the tax rule page, then open the browser console (Ctrl + Shift + J in Chrome, Cmd + Option + J on a Mac). Put the following code in the console. ...

April 26, 2019 · 2 min · Harshvardhan Malpani

How to fix Undefined class constant ‘ARRAY_AS_PROPS’ Fatal Error?

This one cost me some time because the error points at PHP, but the fix was in the Apache configuration. It shows up on PHP applications that use zend-http, the HTTP component of Zend Framework that many projects (Magento 2, for example) install through Composer. The page fails with a fatal error, and the log points to a file inside the vendor folder. I received this error: “Fatal Error: Uncaught error in Undefined class constant ‘ARRAY_AS_PROPS’”. This issue is not related to PHP if you have 7.0 and above. It is Zend Framework’s zend-http module that is affected if an Apache module is not present. ...

April 17, 2019 · 3 min · Harshvardhan Malpani

3 ways to put a webpage on 100% device width

When a page is wider than a phone’s screen, you get a sideways scrollbar, or the whole page is shrunk down with tiny text. These are the three things I check to get a page to fit the device width exactly. <meta name="viewport" content="width=device-width, initial-scale=1"> overflow-x: auto; body,html{max-width:100%} 1. The viewport meta tag. This goes inside the <head> of every page. Without it, mobile browsers lay the page out as if the screen were desktop-sized (around 980px wide in Safari on the iPhone) and then shrink the result to fit. width=device-width makes the layout width match the device’s screen, and initial-scale=1 opens the page at 100% zoom. It’s also what makes CSS media queries for small screens work, because without it the browser reports the desktop-sized width. ...

April 1, 2019 · 2 min · Harshvardhan Malpani

Quick tips on American SALES TAX for developers who are setting up an ecommerce store for USA based organization

So, all of the info you read below is the summary of 6 hours I spent yesterday in gathering information about taxes in USA. – to be particular – Sales Tax. Not Income tax To start with, USA has 50 states, meaning constituent political entity. All states have their own rules for sales tax and there is no nation-wide sales tax as such. So if you are an store owner in any particular, you will have to charge your customers taxes, which you are supposed to pay to the state. ...

March 15, 2019 · 4 min · Harshvardhan Malpani

How to transpose an array in PHP with irregular subarray size?

Transposing an array means turning its rows into columns: the first item of every sub-array becomes the first row, the second items become the second row, and so on. This is handy for CSV-style data where each sub-array is one column (a heading followed by its values) and the columns have different lengths, as in the test code below. A plain nested loop then leaves gaps in the shorter rows: a row can have keys 0 and 2 but no 1, and something like fputcsv(), which ignores keys, would shift the values into the wrong columns. This function fills those gaps with null, so every row of the result has one slot per original sub-array. ...

March 5, 2019 · 3 min · Harshvardhan Malpani

SQL Notes

These are my notes on MySQL statements I keep reaching for when creating and changing tables by hand. They cover creating a table with a foreign key, adding, changing and removing a column, and the key and auto-increment definitions that phpMyAdmin writes into an export. The examples use two tables. emp holds employees, each with a unique emp_code. clients holds clients, each linked to the employee who looks after it. ...

February 18, 2019 · 3 min · Harshvardhan Malpani

How to fix Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI error in SSH?

Put this in your bash profile and run source ~/.bashrc alias composer="/opt/cpanel/ea-php71/root/usr/bin/php /opt/cpanel/composer/bin/composer" As Composer is now available via WHM you can use this to find it: which composer This returned path “/opt/cpanel/composer/bin/composer” for me. If this returns nothing then disregard the rest of this answer, as Composer is not available to you at system level. You can now use php-cli to call this with Composer’s absolute path: php-cli /opt/cpanel/composer/bin/composer install php-cli /opt/cpanel/composer/bin/composer update php-cli /opt/cpanel/composer/bin/composer require whatever/example You may however need to alias php-cli if your system claims this isn’t found. It very much depends how PHP has been deployed on the WHM server. Learn how to fix PHP CLI error. You can do this by adding a user alias to the end of your “.bashrc” or “.bash_profile” file as follows: ...

February 12, 2019 · 1 min · Harshvardhan Malpani

How to switch your DNS to Google DNS or Cloudflare DNS on Windows 10?

So, this is the scenario. You are using some local ISP which has its own DNS server fulfilling your DNS requests but to speed things up and not rely upon a DNS server which is updated less frequently. For that purpose,we can switch our computer’s DNS to some other public DNS like Google’s or Cloudflare DNS. Step 1: Right click the Network Icon in your task bar. Right Click the network icon in taskbar ...

February 10, 2019 · 1 min · Harshvardhan Malpani