You can copy AWS IAM policy below to secure the access of your AWS S3 bucket when using S3 Adapter of Flysystem
{
"Version": "2012-10-17",
"Statement": [
{
'use strict'; | |
const AWS = require("aws-sdk"); | |
const dynamodb = new AWS.DynamoDB(); | |
const querystring = require("querystring"); | |
const http = require("https"); | |
const TWITTER_API_URL = "https://api.twitter.com" | |
const TWITTER_HOSTNAME = "api.twitter.com" | |
/** |
#!/bin/bash | |
# mytop.sh - (Monitor mysql process list with top like screen updates and adiditonal stats like cpu/io usage) | |
# | |
# Sample Output: | |
# | |
# CPU Usage 3.29% user 1.60% system 3.37% io wait 0.00% steal 91.59% idle | |
# Up 17 days 10 hours Load Avg 0.43 0.36 0.35 Processes 1(running) 408(total) Last PID 17825 | |
# +----------+------+-----------+----+---------+------+-------+------------------+ | |
# | Id | User | Host | db | Command | Time | State | Info | | |
# +----------+------+-----------+----+---------+------+-------+------------------+ |
/** | |
* Optimize image image | |
* | |
* https://developers.google.com/speed/docs/insights/OptimizeImages | |
* -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB | |
* | |
* @access public | |
* @param string $filePath Path of the file | |
* @return string Raw image result from the process | |
*/ |
You can copy AWS IAM policy below to secure the access of your AWS S3 bucket when using S3 Adapter of Flysystem
{
"Version": "2012-10-17",
"Statement": [
{
<?php | |
namespace localdisk; | |
use localdisk\Bench; | |
class ImageResizer | |
{ | |
const SRC = './src.jpg'; |
<?php | |
/** | |
* Auto Fit Text To Image | |
* | |
* Write text to image using a target width, height, and starting font size. | |
* | |
* @author Clif Griffin | |
* @url http://cgd.io/2014/auto-fit-text-to-an-image-with-php-and-wordpress | |
* |
This contract is not meant to trick or deceive you; the intention is purely to protect both parties. I have tried to keep the wording as plain as possible, but if anything is unclear, please let me know and I will be more than happy to clarify it with you. Also, until you sign it, please feel free to request to change bits of it to suit your requirements.
In short, [client name] is contracting me, [my name], to [description of my role] between [start date and finish date].
By signing this, you are confirming that you have the power and ability to enter into this contract on behalf of [client's company].
<?php | |
// AWS data | |
$bucketName = "BUCKET-NAME"; | |
$AWSAccessKeyId = "XXXXXXXXXXXXXXXXXXXX"; | |
$AWSSecretAccessKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |
$date = date("Y-m-d"); | |
$dateISO = date("Ymd"); | |
$validTill = date('Y-m-d\TH:i:s.000\Z', time() + (60 * 60 * 4)); // 4 hours |
<img data-src="unicorn.jpg" loading="lazy" alt=".." class="lazyload"/> | |
<script> | |
// Select all images with the class "lazyload" | |
const images = document.querySelectorAll("img.lazyload"); | |
// Check if the browser supports the "loading" attribute | |
if ('loading' in HTMLImageElement.prototype) { | |
// If so, we'll update all <img src> to point to the data-src instead | |
images.forEach(img => { | |
img.src = img.dataset.src; |