An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
<?php | |
$datetime1 = new DateTime("2010-06-20"); | |
$datetime2 = new DateTime("2011-06-22"); | |
$difference = $datetime1->diff($datetime2); | |
echo 'Difference: '.$difference->y.' years, ' | |
.$difference->m.' months, ' | |
.$difference->d.' days'; |
<?php | |
$tanggal = '2023-01-01'; | |
if (Carbon::parse($tanggal)->gt(Carbon::now())){ | |
echo 'Form input tidak tampil'; | |
} else { | |
echo 'Form input tampil'; | |
} |
<?php | |
function formatDate($str) | |
{ | |
return implode("-",array_reverse(explode("-", explode(" ", $str)[0]))); | |
} |
<?php | |
namespace jeremykenedy\LaravelHttps\App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Response; | |
class CheckHTTPS | |
{ |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
<?php | |
$header = [ | |
'typ' => 'JWT', | |
'alg' => 'HS256' | |
]; |
The program below can take one or more plain text files as input. It works with python2 and python3.
Let's say we have two files that may contain email addresses:
foo bar
ok [email protected] sup
[email protected],wyd
hello world!
$(document).on('click', '.btnEdit',function(){ | |
alert("EDIT BUTTON CLICKED"); | |
}); |
<?php | |
class Branch extends Model | |
{ | |
use HasFactory; | |
// custom table name? | |
protected $table = 'tbl_branch'; | |
// custom ID field? |
<?php | |
// source: | |
// https://github.com/yuya-takeyama/php-docx2pdf/blob/master/docx2pdf.php | |
require 'vendor/autoload.php'; | |
\PhpOffice\PhpWord\Settings::setPdfRendererPath('vendor/tecnickcom/tcpdf'); | |
\PhpOffice\PhpWord\Settings::setPdfRendererName('TCPDF'); | |
$temp = \PhpOffice\PhpWord\IOFactory::load('dokumen.docx', 'Word2007'); |