Author archive: ZERIN

Uncategorized
Best way to Learn Anything
September 27, 2024
0
Best way to Learn Anything
These are the concepts that I follow to learn anything in a better way:   How to become expert at thing: 1. iteratively take on concrete projects and accomplish them depth wise, learning “on demand” (ie don’t learn bottom up breadth wise) 2. teach/summarize everything you learn in your own words 3. only compare yourself […]
Uncategorized
Entrepreneur Work Motivation
September 27, 2024
0
“Develop a habit of working on your own projects. Don’t let “work” mean something other people tell you to do. If you do manage to do great work one day, it will probably be on a project of your own. It may be within some bigger project, but you’ll be driving your part of it.” […]
CodeIgniter Framework
How do i install older version of CI4 using composer
October 10, 2023
0
Sometimes when you run git update & composer update, it updates codeigniter framework, then suddenly your app stops working unless you upgrade your codebase as per new framework requirement or downgrade to last version that you had. The below is the command to downgrade codeigniter to a version: # composer require codeigniter4/framework:4.1.5  
Coding php ThirdPartyAPI
hitpath API: Read Affiliates Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/affiliates?all_details=1&offset=$offset&limit=$limit"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPGET, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "auth_token:6d4888962feba3c669176b81edacb185", "accept:application/json", )); $raw_response = curl_exec($ch); $response = json_decode($raw_response); $error = curl_error($ch); $tmp_file = 'h3.txt'; if ($error) { $response->error = curl_error($ch); } else { file_put_contents($tmp_file, $raw_response); //$this->file_transfer->send_file($tmp_file, $tmp_file); } curl_close($ch); echo $raw_response; ?>
Coding php ThirdPartyAPI
hitpath API: Read Campaigns Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/campaigns?all_details=1&offset=$offset&limit=$limit"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPGET, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "auth_token:6d4888962feba3c669176b81edacb185", "accept:application/json", )); $raw_response = curl_exec($ch); $response = json_decode($raw_response); $error = curl_error($ch); $tmp_file = 'h2.txt'; if ($error) { $response->error = curl_error($ch); } else { file_put_contents($tmp_file, $raw_response); //$this->file_transfer->send_file($tmp_file, $tmp_file); } curl_close($ch); echo $raw_response; ?>
Coding ThirdPartyAPI
hitpath API: Read Advertisers Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/advertisers?all_details=1&offset=$offset&limit=$limit"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPGET, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "auth_token:XXXXXXXXXXXXXXXX", "accept:application/json", )); $raw_response = curl_exec($ch); $response = json_decode($raw_response); $error = curl_error($ch); $tmp_file = 'h1.txt'; if ($error) { $response->error = curl_error($ch); } else { file_put_contents($tmp_file, $raw_response); //$this->file_transfer->send_file($tmp_file, $tmp_file); } curl_close($ch); echo $raw_response; ?>
php tcpdf
TCPDF ul li works actually
December 25, 2022
0
$pdf = new PdfLibrary('P', 'mm', 'A4', true, 'UTF-8', false); //$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetTitle('My Title'); $pdf->SetHeaderMargin(30); $pdf->SetTopMargin(30); $pdf->setFooterMargin(30); $pdf->SetAutoPageBreak(true); $pdf->SetAuthor('Author'); $pdf->SetDisplayMode('real', 'default'); $pdf->AddPage(); $pdf->SetLineStyle( array( 'width' => 5, 'color' => array(0,0,0))); $pdf->Line(0,0,$pdf->getPageWidth(),0); $pdf->Line($pdf->getPageWidth(),0,$pdf->getPageWidth(),$pdf->getPageHeight()); $pdf->Line(0,$pdf->getPageHeight(),$pdf->getPageWidth(),$pdf->getPageHeight()); $pdf->Line(0,0,0,$pdf->getPageHeight()); //https://ourcodeworld.com/articles/read/275/how-to-encrypt-a-pdf-password-protection-against-copy-extraction-or-modifications-generated-with-tcpdf-in-php //$pdf->SetProtection(array('print', 'copy','modify'), "ourcodeworld", "ourcodeworld-master", 0, null); $pdf->SetMargins(10, 20, 10, true); //$pdf->Write(5, 'Some sample text'); […]
Commands Mac Server
How to Run PHP Specific Version for a PHP Script in MacOSX?
August 15, 2022
0
Suppose you have a php CLI Script that runs only on php version 5.4, but your default PHP version is 8.0.1. So run the below command to run the php Script in PHP 5.4: # /Applications/MAMP/bin/php/php5.4/bin/php -q test.php If you need to ru the PHP Script inn PHP 7.4 then run the below command: # […]
Linux CentOS
How To Setup a Subdomain with SSL on Amazon Linux 2 AMI
September 16, 2021
0
, , ,
I assume that you can login to Amazon Linux 2 AMI console. Once you login there, type the below command to find where are host file configuration: #apachectl -S go to /etc/httpd/conf.d/ as I can see the hosts file are setup under that folder. # cd /etc/httpd/conf.d/ # ls -al You will see all the […]
CodeIgniter Framework
Codeigniter 4 Tweak: How to Remove public & index.php from browser for better SEO
July 27, 2021
0
, , ,
CodeIgniter4 framework-based site page needs to browse using the public by default. If you want to remove that public from the URL & also if you want to remove index.php from URL, do the following things: Step 1: Copy public folder index.php & .htaccess to the root folder Step 2: Then in the root index.php […]