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
CREATE TABLE db.broken_table ( | |
text_field text, | |
integer_field int, | |
another_text_field text, | |
date timestamp, | |
some_random_text text, | |
PRIMARY KEY ((text_field, integer_field, another_text_field), date) | |
) WITH CLUSTERING ORDER BY (date ASC) | |
AND bloom_filter_fp_chance = 0.01 | |
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'} |
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 | |
$generatorWithTwoWayCommunication = function() | |
{ | |
$randomValue = mt_rand(); | |
yield $randomValue; | |
$receivedFromOuterSpace = yield; | |
$returnValue = yield from subGenerator($receivedFromOuterSpace, $randomValue); | |
return $returnValue; | |
}; |
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 | |
$generatorWithTwoWayCommunication = function() | |
{ | |
$randomValue = mt_rand(); | |
yield $randomValue; | |
$receivedFromOuterSpace = yield; | |
yield $receivedFromOuterSpace * $receivedFromOuterSpace; | |
return $receivedFromOuterSpace * $randomValue; | |
}; |
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 | |
/* | |
* Wykorzystując Illuminate\Database\Query\Builder wyciągam dane z bazy | |
*/ | |
$result = \DB::table('a')->join('b', 'a.id', '=', 'b.a_id')->where('b.id', 1)->get(); | |
/* | |
* Po tej operacji będę miał w garści tablicę instancji stdClass (albowiem ten akurat builder nie wie nic o modelu) | |
* w związku z tym hydruję model i iteruję po wyniku | |
*/ |
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
<?hh //strict | |
function main(): int { | |
//array_shift($args); | |
//var_dump($args); | |
/*$input = Vector{}; | |
foreach ($args->items() as $url) { | |
$input->add(fetch_url($url)); | |
}*/ | |
//var_dump($input); |