Given :
27/05/2020
<?php | |
$deals = [ | |
1 => ['forfait' => 60, 'km' => 0.12], | |
2 => ['forfait' => 0, 'km' => 0.6], | |
]; | |
foreach ($deals as $deal => $dealData) { | |
echo 'Deal '.$deal.': forfait '.($dealData['forfait'] === 0 ? 'gratuit' : 'de '.$dealData['forfait'].'.-').' et '. | |
($dealData['km'] * 100).' cts le kilomètre.'.PHP_EOL; | |
} |
for i in "app_opens" "swipes_likes" "swipes_passes" "matches" "messages_sent" "messages_received"; \ | |
do jq --arg DATA "$i" -n 'reduce (inputs.Usage[$DATA] | to_entries[]) as {$key, $value} ({}; .[$DATA] += $value)' data.json; \ | |
done | |
# Outputs : | |
# { | |
# "app_opens": ... | |
# } | |
# { |
function isNotEmpty(value) { | |
return value !== undefined && value !== null && value !== ""; | |
} | |
$(function() { | |
var customDataSource = new DevExpress.data.CustomStore({ | |
key: "ID", | |
load: function(loadOptions) { | |
var d = $.Deferred(); | |
var params = {}; |
$(function() { | |
var db = DevExpress.data.AspNet.createStore({ | |
key: "ID", | |
loadUrl: '/my/route/endpoint' | |
}); | |
$("#gridContainer").dxDataGrid({ | |
dataSource: { | |
store: db | |
}, | |
height: "100%", |
Nov 28 23:43:56 raspbian mono[5032]: [Info] OwinHostController: Listening on the following URLs: | |
Nov 28 23:43:56 raspbian mono[5032]: [Info] OwinHostController: http://*:8989/ | |
Nov 28 23:44:09 raspbian mono[5032]: [Info] SonarrBootstrapper: Starting Web Server | |
Nov 28 23:44:39 raspbian mono[5032]: * Assertion at mini-arm.c:3817, condition `ji' not met | |
Nov 28 23:44:39 raspbian mono[5032]: ================================================================= | |
Nov 28 23:44:39 raspbian mono[5032]: Native Crash Reporting | |
Nov 28 23:44:39 raspbian mono[5032]: ================================================================= | |
Nov 28 23:44:39 raspbian mono[5032]: Got a SIGABRT while executing native code. This usually indicates | |
Nov 28 23:44:39 raspbian mono[5032]: a fatal error in the mono runtime or one of the native libraries | |
Nov 28 23:44:39 raspbian mono[5032]: used by your application. |
Download as zip https://www.raspberrypi.org/downloads/raspbian/ and extract it
Download and install Etcher https://www.balena.io/etcher/
Plug the SD card in the computer, run Etcher and flash the .img on the SD card, remove the SD card, plug it into the RPi, boot
13115 wget https://www.imagemagick.org/download/ImageMagick.tar.gz | |
13116 tar xvzf ImageMagick.tar.gz | |
13117 cd ImageMagick-7.0.8-60/ | |
13118 ./configure | |
13119 make | |
13120 sudo make install | |
13121 sudo ldconfig /usr/local/lib | |
13122 magick --version | |
13123 convert --version |
#!/usr/bin/env php | |
<?php | |
declare(strict_types=1); | |
use Imagecow\Image; | |
use Symfony\Component\Console\Application; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; |
<?php | |
class CustomDirectoryNamer implements Vich\UploaderBundle\Naming\DirectoryNamerInterface | |
{ | |
public function directoryName($object, PropertyMapping $mapping): string | |
{ | |
if (!$object instanceof HasUploadedFile) { | |
throw new \UnexpectedValueException( | |
sprintf( | |
'The class "%s" only supports objects of type "%s".', | |
self::class, |