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
///This extension contains some usefull helpers for maps | |
///which value contains a list of [V] objects. | |
extension MapList<K, V> on Map<K, List<V>> | |
{ | |
///Add [value] to the list of [key]. | |
///If this map doesn't contain the [key], | |
///a new list is added with [value] as only value. | |
void add(K key, V value) | |
{ |
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
///This extension contains some usefull helpers for lists. | |
extension ListHelpers<E> on List<E> | |
{ | |
///Calculates the sum of the list items. | |
/// | |
/// [callBackValue] returns the number value of the item that is added | |
/// to the sum. | |
int sum(int Function(E item) callbackValue) | |
{ |
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 ResizeTool = joint.elementTools.Control.extend({ | |
getPosition: function(view) { | |
const model = view.model; | |
if(model.attr('root/originalSize') === void 0) { | |
model.attr('root/originalSize', model.attributes.size); | |
} | |
return {x: model.attributes.size.width, y: model.attributes.size.height}; | |
}, | |
setPosition: function(view, coordinates) { | |
view.model.resize(coordinates.x, coordinates.y); |
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 java.util.function.BiFunction; | |
public class Mqtt | |
{ | |
public double calculate(BiFunction<Double, Double, Double> calc, double a, double b) | |
{ | |
return calc.apply(a, b); | |
} |
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 | |
$versie = $detail->getArtikel()->getHuidigReceptVersie(); | |
$detail->recept = \ArtikelInfo::findByArtikelAndReceptVersie($order->klant, $detail->artikel, $versie)->recept_versie; |
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 toArray($columns = null): array | |
{ | |
$array = parent::toArray($columns); | |
//wat een shit hack man man toch | |
$array['klant_silo'] = $this->klant_silo; | |
$array['klant_silo_original'] = $this->klant_silo_original; | |
return $array; | |
} |
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 | |
public function getOriginalEntity(string $entity_class_name) : ?Model | |
{ | |
if(array_key_exists($entity_class_name, $this->entities)) { | |
$entity = $this->entities[ $entity_class_name ]; | |
//copy properties from stdEntity to this entity | |
$stdEntity = $this->getEntity(); | |
foreach($this->entityProperties[ $entity_class_name ] as $property) { | |
$entity->{$property} = $stdEntity->{$property}; | |
} |