- 1
- 2
- 3
- 4
- 5
- 6
$interval = $interval->m;
switch ($interval){
case 1: brake;
case 3: brake;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
$interval = $interval->m;
switch ($interval){
case 1: brake;
case 3: brake;
}
от предыдущего тимлида
0
foreach ($cart = LaraCart::getItems() as $product) {
$product->id;
$product->name;
$product->title_slug;
$product->price;
$product->qty;
$product->photo;
$product->item_type;
}
А не прогнать бы нам просто данные ммм?
+1
size_t nChLen = it_ch_end - it_ch;
до меня дошло не сразу.
+1
There was once a programmer who was attached to the court of the
warlord Wu. The warlord asked the programmer: "Which is easier to design:
an accounting package or an operating system?"
"An operating system," replied the programmer.
The warlord uttered an exclamation of disbelief. "Surely an
accounting package is trivial next to the complexity of an operating
system," he said.
"Not so," said the programmer, "when designing an accounting package,
the programmer operates as a mediator between people having different ideas:
how it must operate, how its reports must appear, and how it must conform to
tax laws. By contrast, an operating system is not limited by outward
appearances. When designing an operating system, the programmer seeks the
simplest harmony between machine and ideas. This is why an operating system
is easier to design."
The warlord of Wu nodded and smiled. "That is all good and well,"
he said, "but which is easier to debug?"
The programmer made no reply.
-- Geoffrey James, "The Tao of Programming"
друзья, а как думаете вы?
что проще делать, а что дебажить?
−2
https://www.php.net/manual/en/migration70.deprecated.php
> The salt option for the password_hash() function has been deprecated to prevent developers from generating their own (usually insecure) salts.
Какой анскилл )))
+1
$loop = React\EventLoop\Factory::create();
$server = new React\Http\Server(function (Psr\Http\Message\ServerRequestInterface $request) {
return new React\Http\Response(
200,
array('Content-Type' => 'text/plain'),
"Hello World!\n"
);
});
$socket = new React\Socket\Server(8080, $loop);
$server->listen($socket);
echo "Server running at http://127.0.0.1:8080\n";
$loop->run();
"ReactPHP".
+1
rt_fold(#{}, Acc) ->
Acc;
rt_fold(Keys, Acc) ->
maps:fold(<.... опущено ...>, Acc, Keys).
0
Набор = РегистрыСведений.ЗначенияСвойствОбъектов.СоздатьНаборЗаписей();
Отбор = Набор.Отбор;
Отбор.Объект.Использование = Истина;
Отбор.Объект.ВидСравнения = ВидСравнения.Равно;
Отбор.Свойство.ВидСравнения = ВидСравнения.Равно;
Отбор.Объект.Значение = Грузополучатель;
Отбор.Свойство.Значение = ПланыВидовХарактеристик.СвойстваОбъектов.НайтиПоНаименованию("GLN").Ссылка;
Набор.Прочитать();
GLN_получ = "";
Если Набор.Количество() > 0 Тогда
Для нумер = 0 по Набор.Количество()-1 Цикл
Свво = Набор.Получить(нумер).Свойство;
Если СокрЛП(Свво.Наименование) = "GLN" Тогда
GLN_получ = Набор.Получить(нумер).Значение;
КонецЕсли;
КонецЦикла;
КонецЕсли;
ОбластьМакета.Параметры.GLN_получ = GLN_получ;
+1
EventBus.$on('drag-element', (element) => {
if (element.type !== 'form') {
setTimeout(() => {
this.dragging = true
}, 1000)
}
}),
EventBus.$on('change-element-order', data => {
this.manageElementOrder(data, this.page.elements)
});
EventBus.$on('change-removed-powered-by', data => {
this.isRemovedPoweredBy = this.theme.isRemovedPoweredBy;
});
EventBus.$on('select-element', (element, flags = {}) => {
let isElExist = false;
if (isElExist) return;
if (element.type !== 'form' || flags.isFormCreated) {
EventBus.$emit('update-email-form', element);
if (flags.isFormCreated) {
EventBus.$emit('add-form')
}
setTimeout(() => {
this.dragging = true
}, 1000)
} else {
EventBus.$emit('open-modal');
EventBus.$emit('set-modal-data', 'email-providers');
}
});
EventBus.$on('remove-element', element => {
if (!this.page.elements) return;
if (element.type == 'form') {
EventBus.$emit('reset-email-provide-list-fields')
}
});
EventBus.$on('updateBackground', (data) => {
this.backgroundImage = data.image;
});
this.$root.$on('onSetPopupPosition', this.setPopupPosition);
VueJS
Центральное хранилище - не, не слышал!
+1
<?php
function array_rot(&$butterbrot) {
$rosenrot = array_shift($butterbrot);
array_push($butterbrot, $rosenrot);
}
function mutate($hydra, $head) {
if (count($hydra) < 1) {
yield [$head];
}
foreach($hydra as $branch) {
$branch[] = $head;
for ($i = 0; $i < count($branch); ++$i) {
array_rot($branch);
yield $branch;
}
}
}
class YOBAMaster {
private $data = [];
public function __get($name) {
$tmp = [];
foreach (mutate($this->data, $name) as $variant) {
$tmp[] = $variant;
}
$this->data = $tmp;
return $this;
}
public function say() {
foreach ($this->data as $item) {
echo implode(' ', $item) . PHP_EOL;
}
$this->data = [];
}
}
$master = new YOBAmaster();
$master->ALLO->YOBA->ETO->TI->say();
$master->YOBI->NET->DOMA->say();
https://ideone.com/aoZ9PX