- 1
- 2
- 3
- 4
- 5
- 6
- 7
temp = (NODE *)malloc(sizeof(NODE));
if (temp == NULL)
{
Free(temp);
Free(task);
return NULL;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+129
temp = (NODE *)malloc(sizeof(NODE));
if (temp == NULL)
{
Free(temp);
Free(task);
return NULL;
}
Курсовик ночью по пьяни. Подстраховался блин.
+169
<!-- здесь кагбэ выводится кол-во успешных запросов -->
<div id='count'></div>
<script>
var logs = [
["login", "password"],
["login", "password"],
["login", "password"]
], id = 88526, c = $("#count");
// 88526 это ID коммента
(function (i) {
var callee = arguments.callee;
$.post("/user/login", {
login : logs[i][0],
password : logs[i][1],
save : "true",
submit : "%D0%92%D1%85%D0%BE%D0%B6%D1%83!"
}, function () {
// on — головать за; against — голосовать против
$.get("/ratings/comment/" + id + "/on", function () {
$.get("/user/exit", function () {
c.html(i);
callee(i + 1);
});
});
});
})(0);
</script>
Внимание! Скрипт для автоматического минусования комментов! Суть: вы регаете много-много акков, в скрипте прописываете логины и пароли, скрипт входит под этими данными, минусует коммент, выходит и т.д. Алсо, если заменить comments на code, можно будет минусовать говнокоды.
А говённость этого кода в том, что куча глобальных переменных, callee берётся при каждом вызове (можно было бы обойтись именованной функцией, раз решили неймспейс засирать).
+157
if ( '' !== $qv['second'] ) {
$this->is_time = true;
$this->is_date = true;
}
if ( '' !== $qv['minute'] ) {
$this->is_time = true;
$this->is_date = true;
}
if ( '' !== $qv['hour'] ) {
$this->is_time = true;
$this->is_date = true;
}
if ( $qv['day'] ) {
if ( ! $this->is_date ) {
$this->is_day = true;
$this->is_date = true;
}
}
if ( $qv['monthnum'] ) {
if ( ! $this->is_date ) {
$this->is_month = true;
$this->is_date = true;
}
}
if ( $qv['year'] ) {
if ( ! $this->is_date ) {
$this->is_year = true;
$this->is_date = true;
}
}
if ( $qv['m'] ) {
$this->is_date = true;
if ( strlen($qv['m']) > 9 ) {
$this->is_time = true;
} else if ( strlen($qv['m']) > 7 ) {
$this->is_day = true;
} else if ( strlen($qv['m']) > 5 ) {
$this->is_month = true;
} else {
$this->is_year = true;
}
}
ВротПресс
+162
switch ($size) {
case 'small':
if ($crop_thumbnail == 3 || $crop_thumbnail == 5 || $crop_thumbnail == 6 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
case 'medium':
if ($crop_thumbnail == 2 || $crop_thumbnail == 4 || $crop_thumbnail == 5 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
case 'large':
Default:
if ($crop_thumbnail == 1 || $crop_thumbnail == 4 || $crop_thumbnail == 6 || $crop_thumbnail == 7 ) {
$crop = 1;
}
break;
}
Phocagallery module, Joomla!
+165
// создает массив с заданным кол-вом ячеек
function array_from_int($count,$val=true,$start=0)
{
$fcount = $count+$start;
for($i=$start;$i<$fcount;$i++)
{
$arr[$i] = $val;
}
return $arr;
}
+159
if ($rightDisplayDelete == 1) {
$images = $model->getData(1);
$this->tmpl['pagination'] = &$model->getPagination(1);
} else {
$images = $model->getData(0);
$this->tmpl['pagination'] = &$model->getPagination(0);
}
И снова модуль Phocagallery для Joomla!
+171
function trim_and_screening(&$item, $key)
{
$item = '`'.$item.'`';
}
+147
function index($name) {
return is_numeric($name)?'_'.$name:(int)substr($name,1);
}
универсальная функция для... угадайте, для чего?
+131
http://molinos.ru/portfolio/a/1/1/
Ждем загрузку, смотрим код. Офигеваем от 300К+ табуляций.
−134
# Fallback static file handler, now with XSendfile support.
if not if(test -f $local_path) {
if(! ~ $#xsendfile 0) {
if(! ~ $#xsendfile_alternate 0)
XSendfileHeader='X-Accel-Redirect'
if not
XSendfileHeader='X-Sendfile'
echo $XSendfileHeader': '`{pwd}^'/'$local_path
}
if not
static_file $local_path
}
if not if(~ $req_path /pub/* && test -f .$req_path) {
if(! ~ $#xsendfile 0) {
if(! ~ $#xsendfile_alternate 0)
XSendfileHeader='X-Accel-Redirect'
if not
XSendfileHeader='X-Sendfile'
echo $XSendfileHeader': '`{pwd}^'/'$req_path
}
if not
static_file .$req_path
}