Posts marked with "Program" in categories

CryptoDonate, The Donation Button For CryptoCurrencies

CryptoDonate is a JavaScript (vanilla JS) library to embed a donation button for cryptocurrency. It doesn’t require any external library and is very lightweight. I created it to replace my existing BTC donation button in my blog. DemoDownload Features Supports BTC, LTC, ETH, XMR Lightweight Have an embed script Easy usage Supports theming Widget You can simply add the CryptoDonate widget to your blog or site by using this Widget Maker Tool.... [READ MORE]

Draw Animated Christmas Tree In Bash

It’s Christmas again and you’ll be receiving all kinds of greetings. How about greeting them back with a fancy way ? Show off your nerdiness with this super cool Christmas Tree in Bash. All you need is a bash shell. Most systems have bash shell by default, so you don’t have to install anything for this ! All thanks goes to the Argentian programmer Sergio Lepore for this cool script.... [READ MORE]

Create A Profile Picture Framer Web App

You might have seen your Facebook friends’ fancy profile pictures with the frame of the sports team they support. These days for any major events, the best way to support them is by adding a frame to your profile picture with their logo. Football (soccer) is my favorite sport. My state Kerala have a franchise club in the Indian Super League called Kerala Blasters. We are the largest club by average crowd attendance and the fans are so passionate.... [READ MORE]

PHP Output Buffering For Noobies

You might have heard about output buffering while you code in PHP. I will tell you what it is and how to use it simply. “Output Buffering” Meaning “Buffering” in computing means store (data) in a buffer while it is being processed or transferred. This is exactly what PHP does too. But, the default mechanism is not this. It is turned off by default i.e : data is not stored in a buffer while it is being processed or transferred.... [READ MORE]

Run Multiple WebSocket Services On Same Port

Are you as crazy as me when developing WebSocket applications ? It’s so awesome to work with WebSockets that will blow up your mind and irritate you at the same time. WebSockets can be used for any real time applications such as : Games Chat News File Transfer And because it’s impact is so vast, we can develop as many applications as we want. But, a problem arises for freebies like me and you.... [READ MORE]

How To Install & Run Composer Binaries Globally

Take PHPUnit as an example. You can install it using Composer doing this : composer require phpunit/phpunit This will install a phpunit shortcut in vendor/bin directory. This obviously means you can run it. But, you would have to point to the exact location of the phpunit file to run : /home/username/mysite/vendor/bin/phpunit phpunit.xml But, that’s long and uncomfortable. And you would have to install PHPUnit separately for each projects. I’m gonna tell you how to install binaries globally as well as running it simply.... [READ MORE]

Doing Random Things in PHP

Suppose you want to display something randomly in a news feed, or pick random elements from an array, or anything random in general. Programming Languages are used to define the way how something must be done. Hence in a technical way, it can’t do things randomly on it’s own. Otherwise it would be an AI (Artificial Intelligence). Doing random things is not done at compiling, but in execution. In case of PHP, this doesn’t matter as it’s an interpreter.... [READ MORE]

Convert Seconds To Hours, Minutes in PHP

Say you’re running a process that runs in the background. It’s better to not let the user lose their patience and tell them when it will finish. But, you have the time remaining in seconds. If we show the user : 567 seconds to complete He/she (user) would have to take a calculator and convert it into minutes or hours. Or if the guy/gal is not a math genius, he would close the UI and say “What the Hell ?... [READ MORE]

Convert Bytes To KB, MB, GB in PHP

Say you were displaying the size of a file in PHP. You obviously get the file size in Bytes by using filesize(). You won’t have any idea what the file size is if you read it in Bytes. Bytes is useful for file transmission in a network, but not for human usage. So, it’s better to convert it to human readable form. The circled areas show the converted size from Bytes.... [READ MORE]

Create Table Rows With Alternate Colours in PHP

If you have a lot of rows on a table, users will find it difficult to find which cell is in what row. This is because all the rows have the same colour. If we alternate the colours, then the table will be more understandable. We can alternate colours odd-even wise or by 3 rows etc. It can be easily done in PHP. I will tell you two ways to do it.... [READ MORE]

Follow/Subscribe

Telegram 

Mastodon  Twitter

GitHub GitLab

Subdomains

Demos  Lab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab