This file contains 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 | |
use Kirby\Http\Remote; | |
use Kirby\Cms\File; | |
use Kirby\Cms\Page; | |
use Kirby\Filesystem\F; | |
use Kirby\Filesystem\Mime; | |
use Kirby\Toolkit\Dom; | |
use Kirby\Toolkit\Str; | |
use Kirby\Toolkit\V; |
This file contains 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
/opt/homebrew/opt/php@8.0/bin/php $(which composer) update |
This file contains 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
cd ../content/; find . -name "*.png" -exec bash -c 'file="{}"; cd "$(dirname "$file")"; npx @squoosh/cli \ | |
--oxipng '{"quality":90}' \ | |
$(basename $file)' \ | |
cd ../content/; find . -name "*.jpg" -exec bash -c 'file="{}"; cd "$(dirname "$file")"; npx @squoosh/cli \ | |
--mozjpeg '{"quality":90}' \ | |
$(basename $file)' \; |
This file contains 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
const svgPolygon = '12.034 19.674 10.634 18.28 14.309 14.61 2.125 14.61 2.125 12.572 14.309 12.572 10.634 8.897 12.034 7.508 18.117 13.591'; | |
const viewBoxWidth = 25; | |
const viewBoxHeight = 25; | |
const array = [...svgPolygon.matchAll(/[\d.]+/g)]; | |
let output = ''; | |
array.forEach((item, key) => { | |
if (key % 2 === 0) { | |
output += `${(Math.round(((item / viewBoxWidth) * 100) * 1000)) / 1000}% `; | |
} else { | |
output += `${(Math.round(((item / viewBoxHeight) * 100) * 1000)) / 1000}%`; |
This file contains 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 | |
namespace Kirby\Data; | |
use Exception; | |
use Spyc; | |
use \Symfony\Component\Yaml\Yaml as SymfonyYaml; | |
function array_map_recursive(callable $func, array $array) { | |
return filter_var($array, \FILTER_CALLBACK, ['options' => $func]); |
This file contains 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
figure > span:first-child{ | |
display: block; | |
} | |
figure > span:first-child + img{ | |
display: block; | |
transform: translateY(-100%); | |
} |
This file contains 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
(email: name@domain.com subject: reserve tickets) |
This file contains 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
import processing.serial.*; | |
Serial myPort; | |
int x = 0; | |
void setup() { | |
size(1200, 400); | |
println(Serial.list()); //list of available serial ports | |
String portName = Serial.list()[3]; //replace 0 with whatever port you want to use. | |
println(portName); |