Author: David Raleche
Twitter : https://twitter.com/DavidRaleche
Newsletter : Subscribe here
Store : https://david.raleche.com/shop
-- force discard —
git reset --hard origin/<davidBranch_name>
example with the master branch
git reset --hard origin/master
vendor/bin/phpcs --standard=PSR2 --colors -p src/ && vendor/bin/phpunit --stop-on-failure
PSR-2 Code Styling
This command returns all PSR-2 (code styling errors)
vendor/bin/phpcs --standard=PSR2 ~/directory_to_scan
vendor/bin/phpcs –standard=PSR2 –colors -pv src/ApiBundlewith more information
This command fix all fixable PSR-2 (code styling errors) issues
vendor/bin/phpcbf --standard=PSR2 --report=json ~/directory_to_scan
Run the Functional and Unit Tests
- The ideal image size for Twitter Cards is 800px by 418px, a 1.91:1 ratio. For App Cards, you can go with 800px by 800px for a 1:1 ratio.
- Videos can also be used in Twitter Cards. The recommended size for Website Card videos is 1200px by 1200px, or 1:1 aspect ratio. For App Card and Direct Message Card, the recommended size is 640px by 360px for a 16:9 ratio, or 360px by 360px for a 1:1 ratio.
- Twitter supports images that are JPEG or PNG format; no GIFs are allowed here.
- For best results, make sure your image is no larger than 3 MB.
- The approved file types are MP4 or MOV, ideally less than 30 MB in size, and no more than 1 GB when it comes to videos.
- Twitter advises a short video for these cards, so aim to keep it less than 15 seconds.
- For videos, place your logo in the upper left-hand corner.
- All Website Card videos are required to have closed captioning or text overlays.
source : https://www.adobe.com/express/discover/sizes/twitter
PHPUnit, how to stop on failure ?
Find below the command that exit out phpunit ghracefully when a first error pop out=
How to get the exponent symbol (^) ?
well just copy it below :
0, 1, 2, 3, 5, 8, 13, 21, 34
This is the Fibonacci Sequence to use when updating your story points
1 – Easy (1-2 days)
2 – Medium (1-2 days)
3 – Hard (3-5 days)
5- Very hard (3-8 days)
8 – Difficult (8-12 days)
13 – Very difficult (8-15 days)
Latency is the delay between a user’s action and a web application’s response to that action, often referred to in networking terms as the total round trip time it takes for a data packet to travel.
How to reduce latency
Content Delivery Network (CDN) providers provide customers with private networks that allow them to bypass the public internet. Therefore, these private networks reduce latency by providing more efficient paths for data packets to travel on.
Also the caching techniques is resolving the latency issue
How Latency Works
Consider that you are buying a product through an online shop and you press the “Add to Cart” button for a product that you like.
The chain of events that occur when you press that button are as follow :
- Firstly, You press the “Add to Cart” button.
- Secondly, The browser identifies this as an event and initiates a request to the website’s servers. The clock for latency starts now.
- Thirdly, The request travels to the site’s server with all the relevant information.
- Then, The site’s server acknowledges the request. The first half of the latency is complete.
- The server accept the request status.
- The site’s server replies to the request with relevant information.
- The request reaches your browser and in the card the system adds the product. With this, the latency cycle is completed.
The latency is the time that it takes for all these events to complete.
How to find the RAM memory ?
Many times you have to figure out the RAM memory on a server or your laptop let’s say. it works with a Macbook. The easiest way is to open a terminal and execute the following command
How to find the microprocessor speed ?
Here is the command to find the microprocessor speed in unix machine. MacOs is a unix machine so you can run the following command :