- 1
- 2
Струйкер!
Засунь симо-салапимо в кувшин.
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
Струйкер!
Засунь симо-салапимо в кувшин.
−1
function running(html, clear) {
var id, brk = true;
if(clear)
html.className = "";
if(html.className != "Ready") {
if(html.children.length > 0) {
if(!clear) {
for(id = 1; id < html.childNodes.length; ++ id) {
var active = findActive(html.childNodes[id]);
if(active == null) {
brk = true;
break;
}
brk = active.className != "Ready" ? false : brk;
}
}
if(!brk && html.childNodes[0].value && html.childNodes[0].max) {
if(clear)
html.childNodes[0].value = 1;
else
if(html.childNodes[0].value <= html.childNodes[0].max) {
++ html.childNodes[0].value;
if(brk) {
for(id = 1; id < html.childNodes.length; ++ id)
findActive(html.childNodes[id], true);
html.parentNode.className = "";
}
return null;
} else {
html.parentNode.className = "Ready";
html.className = "";
return html;
}
}
if(!clear)
html.className = html.className != "Active" ? "Active" : "Ready";
return null;
} else {
if(!clear)
html.className = html.className != "Active" ? "Active" : "Ready";
return html;
}
}
return html;
}
Должен бегать по вложенным элементам и анимировать их.
0
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/style.css">
<!--[if IE]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js"></script>
<![endif]-->
<style>
article, aside, details, figcaption, figure, footer,header,
hgroup, menu, nav, section { display: block; }
</style>
</head>
<body>
<form id="form">
<input type="date">
<input id="inp" type="email" required>
<input type="submit">
</form><br>
<section itemtype="http://data-vocabulary.org/Person" itemscope>
<h1 itemprop="name">Mark Pilgrim</h1>
<p><img itemprop="photo" src="http://www.example.com/photo.jpg" alt="[me smiling]"></p>
<p><a itemprop="url" href="http://diveintomark.org/">weblog</a></p>
</section>
<progress id="pg" value="50" max="100">
<br>
<script>
let forward = true;
function pgset() {
if(forward) {
pg.value = +pg.value + 1;
if(+pg.value == 100)
forward = false;
}
else {
pg.value = +pg.value - 1;
if(+pg.value == 0)
forward = true;
}
}
//setInterval(pgset, 100); //нахуй!
</script>
</body>
</html>
Куда мне ещё говно скидывать??
0
def create_delta(self, timestamp, subs: set):
sym_subs = subs.symmetric_difference(self.subs)
added_subs = sym_subs.difference(self.subs)
removed_subs = sym_subs.difference(subs)
return DeltaEntry(timestamp, added_subs, removed_subs)
−109
Анальные утехи - населению
https://img09.rl0.ru/a089d483411795d19aa2712afde93c8c/c592x444/pbs.twimg.com/media/CIcTC_dWoAAUPnE.jpg
+2
$this->db->query("UPDATE " . DB_PREFIX . "manufacturer SET name = '" . $this->db->escape((string)$data['name']) . "', sort_order = '" . (int)$data['sort_order'] . "' WHERE manufacturer_id = '" . (int)$manufacturer_id . "'");
if (isset($data['image'])) {
$this->db->query("UPDATE " . DB_PREFIX . "manufacturer SET image = '" . $this->db->escape((string)$data['image']) . "' WHERE manufacturer_id = '" . (int)$manufacturer_id . "'");
}
Opencart https://github.com/opencart/opencart/blob/master/upload/admin/model/catalog/manufacturer.php#L35-L39
+3
return query instanceof RegExp ?
(function () {
fn.each(function (id) {
if (id.match(query)) {
seatSet.push(id, this);
}
});
return seatSet;
})() :
(query.length == 1 ?
(function (character) {
//user searches just for a particual character
fn.each(function () {
if (this.char() == character) {
seatSet.push(this.settings.id, this);
}
});
return seatSet;
})(query) :
(function () {
//user runs a more sophisticated query, so let's see if there's a dot
return query.indexOf('.') > -1 ?
(function () {
//there's a dot which separates character and the status
var parts = query.split('.');
fn.each(function (seatId) {
if (this.char() == parts[0] && this.status() == parts[1]) {
seatSet.push(this.settings.id, this);
}
});
return seatSet;
})() :
(function () {
fn.each(function () {
if (this.status() == query) {
seatSet.push(this.settings.id, this);
}
});
return seatSet;
})();
})()
);
https://github.com/mateuszmarkowski/jQuery-Seat-Charts -- отсюда, заставила нелегкая использовать на одном мелком проекте. в пост запилил самый блистательный и ароматный кусок
0
procedure ustbet;
begin
if (200*GCtrl.CurLines>coins.realBalance) then begin
if (150*GCtrl.CurLines>coins.realBalance) then begin
if (100*GCtrl.CurLines>coins.realBalance) then begin
if (50*GCtrl.CurLines>coins.realBalance) then begin
if (40*GCtrl.CurLines>coins.realBalance) then begin
if (30*GCtrl.CurLines>coins.realBalance) then begin
if (20*GCtrl.CurLines>coins.realBalance) then begin
if (15*GCtrl.CurLines>coins.realBalance) then begin
if (10*GCtrl.CurLines>coins.realBalance) then begin
if (5*GCtrl.CurLines>coins.realBalance) then begin
if (4*GCtrl.CurLines>coins.realBalance) then begin
if (3*GCtrl.CurLines>coins.realBalance) then begin
if (2*GCtrl.CurLines>coins.realBalance) then begin
if (1*GCtrl.CurLines>coins.realBalance) then begin
end else Coins.CurBet:=1
end else Coins.CurBet:=2;
end else Coins.CurBet:=3;
end else Coins.CurBet:=4;
end else Coins.CurBet:=5;
end else Coins.CurBet:=10;
end else Coins.CurBet:=15;
end else Coins.CurBet:=20;
end else Coins.CurBet:=30;
end else Coins.CurBet:=40;
end else Coins.CurBet:=50;
end else Coins.CurBet:=100;
end else Coins.CurBet:=150;
end else Coins.CurBet:=200;
coins.AllBet:=Coins.CurBet*gctrl.curlines;
end;
Предположительно, установка текущей ставки в слотовой игре. Но это ещё далеко не самый трэш в этом говнопроекте.
−1
if (typeof _dragon_pic_shift[el]['did'] === typeof undefined || typeof _dragon_pic_shift[el]['pic_id'] === typeof undefined ) {
continue;
}
if (_dragon_pic_shift[el]['did'].indexOf(active_dragon_id) >= 0
&& _dragon_pic_shift[el]['pic_id'].indexOf(active_dragon_lvl) >= 0
&& _dragon_pic_shift[el]['place'] == this_place) {
css_shift_class = _dragon_pic_shift[el]['css_shift'];
break;
}
это какой то новый уровень построения условий в js
−101
Шалом, сученьки. Не ждали?
Пишу на C++/PHP, программирую микроконтроллеры, пью чёрную воду, ебусь в зад, принимаю за гланды