-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+133
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
// Common styles for any tag
.clear {
clear: both;
}
.grey {
color: $pcolor;
}
.colored {
color: $headercolor;
}
.siteName {
font-family: $siteNameFontFamily;
}
.common-ctx {
color: $pcolor;
font-size: 105%;
}
.common-ctx-light {
color: $pcolorlight;
font-size: 100%;
}
.fs95 {
font-size: 95%;
}
.undisplayable {
display: none;
}
.displayable {
display: block;
}
hr.black-hr {
border-color: black;
margin: 10px 0 10px 0;
}
hr.grey-hr {
border-color: #cccccc;
margin: 20px 0 30px 0;
}
.w30p {
width: 30% !important;
}
.w100 {
width: 100%;
}
.fl {
float: left;
}
.p0 {
padding: 0 !important;
}
Самые интуитивно-понятные имена CSS-классов.
crazyh,
28 Января 2015
-
+137
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
// For a portable version of timegm(), set the TZ environment variable to
// UTC, call mktime(3) and restore the value of TZ. Something like
#include <time.h>
#include <stdlib.h>
time_t
my_timegm(struct tm *tm)
{
time_t ret;
char *tz;
tz = getenv("TZ");
if (tz)
tz = strdup(tz);
setenv("TZ", "", 1);
tzset();
ret = mktime(tm);
if (tz) {
setenv("TZ", tz, 1);
free(tz);
} else
unsetenv("TZ");
tzset();
return ret;
}
Цитата из man timegm. Сборка unix timestamp из компонент (год, месяц и т.п.).
Удобно, наглядно, потокобезопасно.
bormand,
23 Января 2015
-
+157
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
function run()
{
var test = [60, 1, 5, 70, 8];
var biggest = 100;
var biggest_index = 0;
for (var i = 0; i < test.length; i++)
{
if (test[i] < test[i + 1])
{
biggest = test[i + 1];
test[biggest - [i + 1]] = [biggest];
}
}
test[test.length] = biggest;
}
run();
таск был найти наибольшего эллемента масива [60, 1, 5, 70, 8]; во что получилось у коллеги новобранца. это был его 20-ты опыт ;)
apostolovd,
22 Января 2015
-
+94
- 1
MenuGame extends GameMenu
jangolare,
19 Января 2015
-
+148
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
<html>
<head>
<title>Тест</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div align="center">
<h1>Задание</h1>
Написать решение c использованием ООП, которое позволяет переводить целые числа в каком-нибудь диапазоне (c миллионами включительно) в текст ( разговорный)<br>
на трех языках (рус., англ., укр.)
</div>
<form action="receivenumber.php" method="post">
<label for="textnumber">Число:</label>
<input type="number" id="textnumber" name="textnumber" required
min="-9999999" max="9999999" step="1"/><br>
<label for="selectlanguage">Выбирите язык:</label>
<select id="selectlanguage" name="selectlanguage">
<option value="eng">English</option>
<option value="ukr">Ukrainian</option>
<option value="rus" selected>Russian</option>
</select><br>
<input type="submit" name="submitnumber" value="Отправить"><br>
</form>
</body>
</html>
А это файл "index.html", который передает данные скрипту "receivenumber.php"
ppd,
23 Декабря 2014
-
+137
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
void _device_ChangeStsConnect(bool Conn)
{
switch (Conn)
{
case true: Start(); break;
case false: Stop(); break;
default: break;
}
}
"Классический" switch булевой переменной.
Qetu107,
25 Ноября 2014
-
+163
- 1
$result = $db->query("update `" . $table_prefix . "options` set `option_value`='a:2:{i:0;b:0;s:8:" . '"auto_add"' . ";a:0:{}}' where `option_name`='nav_menu_options';");
unserialize "глазами на лету" - ЛЕГКО!!!!
taras_shs,
06 Ноября 2014
-
+170
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
<form id ='activate'>
<div class ='form-control'>
<label>Введите код подтверждения из SMS</label>
<input type ='text' name ='code' class ='form-control' />
</div>
<button class = 'btn btn-success'>Активировать</button>
</form>
<script>
$(function () {
$('#activate').submit(function () {
if ($('#activate [name="code"]').val != '<?php echo $secretCode; ?>') {
alert('Вы ввели неверный код!')
return false;
}
})
})
</script>
Бог безопасности
Snickers,
15 Октября 2014
-
−115
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
ls -laF /usr/lib/x86_64-linux-gnu/libcurl.so.4.2.0
if [ "$?" -ne 0 ]; then
current_location=$PWD
gzip -dc < curl-7.22.0.tar.gz | tar -xf -
cd curl-7.22.0
./configure --prefix=/usr
make
make install
cd $current_location
else
echo "libcurl.so.4.2.0 already exist!"
fi
Ключ -f? Нет, не слышали.
codemonkey,
12 Октября 2014
-
+140
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
@foreach (var groupTest in Model.Select(t => t.TestType).Distinct())
{
<div class="form-column form-column2">
<div class="static-height">
<p class="content-subblock-title left upper-text">
<label>
@if (@groupTest.GetEnumDescription().Length < 34)
{
<text> </text>
}
@groupTest.GetEnumDescription()
</label>
</p>
@foreach (var item in Model.Where(t => t.TestType == groupTest).OrderBy(t => t.Order))
{
<div class="donation-row">
<label>@item.TestName</label>
<span class="@item.TestClass blood-test-value-don">
@item.TestValue
</span>
</div>
}
</div>
</div>
}
Я пялюсь на этот кусок вот уже полчаса...
amatenkov,
17 Сентября 2014