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 App\Nova\Fields; | |
use Closure; | |
use Laravel\Nova\Http\Requests\NovaRequest; | |
use Laravel\Nova\Fields\File; | |
class MyFile extends File { | |
protected function fillAttribute(NovaRequest $request, $requestAttribute, $model, $attribute) | |
{ | |
$hasExistingFile = ! is_null($this->getStoragePath()); |
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
use bevy::prelude::*; | |
use bevy_editor_pls::*; | |
fn main() { | |
App::new() | |
.add_plugins(DefaultPlugins) | |
.add_plugin(EditorPlugin) | |
.add_plugin(bevy::diagnostic::FrameTimeDiagnosticsPlugin) | |
.add_plugin(bevy::diagnostic::EntityCountDiagnosticsPlugin) | |
.add_startup_system(startup_system) |
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
<!-- Needed to postpone deferred bindings --> | |
<input type="hidden" id="session-key" /> | |
<!-- A basic textarea which will listen for drag'n'drop events --> | |
<textarea id="post-content"></textarea> | |
<!-- A paragraph to display upload guide --> | |
<p id="upload-informations"></p> | |
{% put scripts %} |
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 | |
class PrestaShopValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
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 | |
class TheliaValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
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
public function testOldReadMessagesAreDeletedFromDatabase(): void | |
{ | |
// Register messages from current and another user's city | |
$this->city2->history->register('11111 Message'); | |
$this->city->history->register('22222 Message'); | |
// Back from the future | |
DB::update( | |
"UPDATE histories SET deleted_at = NOW() - CONCAT(?::VARCHAR, ' 1 second')::INTERVAL", | |
[config('game.delete_read_message_after')] |
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
public function testSacrifyEggsIncreaseFood(): void | |
{ | |
$expected_food = $this->city->getFood(); | |
$this->city->buildings->nursery->populate(4, 'warrior'); | |
$expected_food += 4 * config('city_default_values.abilities.food_ratio_for_sacrifices_egg'); | |
$this->city->buildings->nursery->sacrifyEggs(4, 'egg'); | |
$this->assertEquals($expected_food, $this->city->getFood()); |
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
public function testUserCanGetAllAchievements(): void | |
{ | |
for($i = 0; $i < 3; $i++) { | |
$this->city->buildings->nursery->populate(10, 'warrior'); | |
$this->city->buildings->nursery->sacrifyEggs(10, 'egg'); | |
} | |
$larvae_offset = config('game.total_development_time.end') - config('game.development_times.larvae.end') + 25; | |
for($i = 0; $i < 3; $i++) { | |
$this->city->buildings->nursery->populate(10, 'warrior'); |
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
{ | |
"data": [ | |
{ | |
"name": "Disease-it", | |
"url": "http://disease-it.jeuweb.org/", | |
"image": "https://img.itch.zone/aW1nLzMxMTA5ODQucG5n/original/zO55Li.png", | |
"description": null, | |
"email": null, | |
"id_thread": 12568 | |
}, |
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 max_pending_promises = 3 | |
export default class Queue { | |
static queue = []; | |
static nb_pending_promises = 0; | |
static enqueue (promise) { | |
return new Promise((resolve, reject) => { | |
this.queue.push({ | |
promise, |
NewerOlder