- Download webp decoder from Google's WebP utilities and libraries
- Place dwebp.exe on the same folder with the images
- Create PHP file and paste the source below
- Run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2... | |
# This also works perfectly for all static file content in all projects | |
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config. | |
# Example: | |
# http://example.com - Main Laravel site as usual | |
# http://example.com/about - Main Laravel site about page as usual | |
# http://example.com/robots.txt - Main Laravel site static content as usual | |
# http://example.com/api/v1 - Lumen v1 api default / route | |
# http://example.com/api/v1/ - Lumen v1 api default / route |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dir = __DIR__ . '/routes/'; | |
$files = glob($dir . "*.php"); | |
foreach($files as $file) | |
{ | |
require $file; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'defuse-crypto.phar'; | |
use Defuse\Crypto\Key; | |
use Defuse\Crypto\Crypto; | |
function loadEncryptionKeyFromConfig() | |
{ | |
$keyAscii = 'def00000288b40f6e9f784932da638b3a01079fd620f75f8ac77e3999dbf0dc76b96fef7a52bb1b931196f1693a45a0921373d2b0542e70f0c1abc399a849ce4e174e2e9'; | |
return Key::loadFromAsciiSafeString($keyAscii); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$mysqli = new mysqli('localhost', 'root', '', ''); | |
if ($mysqli->connect_errno) { | |
throw new RuntimeException('mysqli connection error: ' . $mysqli->connect_error); | |
} | |
/* Set the desired charset after establishing a connection */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
use DiDom\Document; | |
$client = new Client(); | |
$url = 'https://www.bca.co.id/id/informasi/kurs'; | |
$userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* taken from: */ | |
/* https://stackoverflow.com/questions/38552003/how-to-decode-jwt-token-in-javascript-without-using-a-library?noredirect=1&lq=1 */ | |
const token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImp0aSI6ImU3YjQ0Mjc4LTZlZDYtNDJlZC05MTZmLWFjZDQzNzhkM2U0YSIsImlhdCI6MTU5NTg3NzUxOCwiZXhwIjoxNTk1ODgxMTE4fQ.WXyDlDMMSJAjOFF9oAU9JrRHg2wio-WolWAkAaY3kg4'; | |
const tokenDecodablePart = token.split('.')[1]; | |
const decoded = Buffer.from(tokenDecodablePart, 'base64').toString(); | |
console.log(decoded) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates an OpenSSL certificate | |
* @param $dn Array Associative array "key"=>"value" | |
* @param $duration int Number of days which the certificate is valid | |
* @throws Exception If there are any errors | |
* @return Array Associative array with the security elements: "cer"=>self signed certificate, "pem"=>private key, "file"=>path to the files | |
* | |
* @see http://www.php.net/manual/en/function.openssl-csr-new.php | |
* @author Pep Lainez | |
*/ |
Find the best resources for learning Google Apps Script, the glue that connects all GSuite services including Gmail, Google Drive, Calendar, Google Sheets, Forms, Maps, Analytics and more.
A good place to learn more about Google Apps Script is the official documentation available at developers.google.com. Here are other Apps Script resources that will help you get up to speed.
- Google Apps Script Code Samples by Amit Agarwal
- Google Apps Script Development - Create Google Apps Script projects locally inside VS Code - video tutorial
- Awesome Google Scripts by Amit Agarwal
- Google Developer Experts - Follow Apps Scr