Skip to content

Instantly share code, notes, and snippets.

View videni's full-sized avatar
🎯
Focusing

vidy videni

🎯
Focusing
  • Chengdu
View GitHub Profile
@videni
videni / gist:c19c6ffdfc90fad16412ce5aa89f6bb6
Last active July 1, 2024 07:24
A aswsomes 1200 line method
public function QueryBuilder(array $criteria, array $depths = []): QueryBuilder
{
$builder = QueryBuilder::for(Order::class);
$condition = $depths['condition'] ?? '';
$with = [
'urgentType',
// 'orderItems',
// 'orderLogisticsFeatures',
'orderItemsField',
@videni
videni / gist:33c00216b0bec5498d36c1130899d235
Last active July 18, 2023 08:15
php-save-load-using-require-method-race condition-demo
<?php
$cachePath = '/tmp/t.php';
$put = function($cachePath){
$code = '<?php';
$code .= "\n\n";
$code .= 'return ' . var_export([], true) . ';';
file_put_contents($cachePath, $code, LOCK_EX);
};
@videni
videni / History|-101d41c1|entries.json
Last active June 15, 2022 06:00
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///home/vidy/www/wshop.code-workspace","entries":[{"id":"J4V7.code-workspace","timestamp":1655104173437}]}