These are the steps to build latest libvips (8.7.4) deb package on ubuntu 18.04
##1. install build scripts
# sudo apt install build-essential devscripts
##2. download vips source
These are the steps to build latest libvips (8.7.4) deb package on ubuntu 18.04
##1. install build scripts
# sudo apt install build-essential devscripts
##2. download vips source
<?php | |
/** | |
* | |
* Inspired by: https://github.com/box/spout/issues/368 | |
* | |
* Simple helper class for Spout - to return rows indexed by the header in the sheet | |
* | |
* Author: Jaspal Singh - https://github.com/jaspal747 |
| | o |
|--- ,---. ,---. |---. ,---. . ,---. ,---. | ,---. ,---.
| |---' | | | | | | | | | | | | |
`---' `---' `---' ` ' ` ' ` `---' `---' `---' `---' `
N E X T G E N E R A T I O N G A T E W A Y
--------------------------------------------------------------------
NG GATEWAY SIGNATURE DRINK
<?php | |
// run plugin OnFileManagerUpload | |
switch ($modx->event->name) { | |
case "OnFileManagerUpload": | |
if(!empty($files)){ | |
foreach($files as $file){ | |
if ($file['type'] != "image/jpeg" && $file['type'] != "image/png") | |
return; | |
// max number of pixels wide or high | |
$max_image_dimension = $modx->getOption('max_image_dimension',$scriptProperties,0); |
(cors) { | |
@cors_preflight{args.0} method OPTIONS | |
@cors{args.0} header Origin {args.0} | |
handle @cors_preflight{args.0} { | |
header { | |
Access-Control-Allow-Origin "{args.0}" | |
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" | |
Access-Control-Allow-Headers * | |
Access-Control-Max-Age "3600" |
import numpy as np | |
import cv2 | |
def correction( | |
img, | |
shadow_amount_percent, shadow_tone_percent, shadow_radius, | |
highlight_amount_percent, highlight_tone_percent, highlight_radius, | |
color_percent | |
): | |
""" |
<?php | |
namespace App\Twig; | |
use Twig\Extension\AbstractExtension; | |
use Twig\TwigFilter; | |
class AppExtension extends AbstractExtension | |
{ | |
public function getFilters(): array |
#!/bin/bash | |
# put into /usr/local/bin/xdebug and make it executable: chmod +x /usr/local/bin/xdebug | |
# Usage: | |
# xdebug # toggle...switch on or off, depending of the current state | |
# xdebug on # enable xdebug | |
# xdebug off # disable xdebug | |
On M1 machines, Docker for Mac is running a lightweight linux ARM VM, then running containers within that, so containers are essentially running natively. Don't be fooled by the fact the UI or binary CLI tools (e.g. docker
) might require Rosetta.
Within that VM is an emulation layer called QEmu. This can be used by docker to run Intel containers. This does not use Rosetta at all, and has a roughly 5-6X performance penalty. (If you just upgraded your CPU this may result in a similar performance to your old machine!)
Many images in public registries are multi-architecture. For instance at the time of writing on Docker Hub the php:8.0-cli
image has the following digests:
<?php | |
class Intercept extends \php_user_filter | |
{ | |
public static $cache = ''; | |
public function filter($in, $out, &$consumed, $closing) | |
{ | |
while ($bucket = stream_bucket_make_writeable($in)) { | |
self::$cache .= $bucket->data; | |
$consumed += $bucket->datalen; |