- 1
https://github.com/wiistriker/govnokod.ru
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+86
https://github.com/wiistriker/govnokod.ru
Развлечемся?
+95
function IntToHex(Num: Int64; Digits: Byte): String;
type
DataInt = Array[0..7] of Byte;
var
I:Byte;
Data: ^DataInt;
begin
Data := @Num;
Result := '';
for I := Trunc(Digits/2)-1 downto 0 do begin
if SizeOf(DataInt) < I then
Result := Result+'00'
else begin
case Data^[I] of
0: Result := Result+'00';
1: Result := Result+'01';
2: Result := Result+'02';
{ ........... }
253: Result := Result+'FD';
254: Result := Result+'FE';
255: Result := Result+'FF';
end;
end;
end;
end;
Давно писал функцию для перевода числа в 16-ричное представление.
Причина - нужно было отдельную функцию без лишнего.
Вот такой вот жестокий быдло код :))
−98
# -*- coding: cp1251 -*-
beer = u"бутылок пива стоят на столе. Одна упала."
botle = 100
for i in range(1, 100):
print (botle-i), beer
print u"Нету больше пива на столе :-("
Пива не будет :-(
+140
<!-- Скрипт иерархичесского аккардиона -->
Не говнокод, но говноречь - 3 ошибки в 2 словах.
"Девелоперы" научились подключать jQuery, а вот русский язык пока что не осилили.
Эти грамотеи работают на "Первом канале", см. http://www.1tv.ru/videoarchiver/.
+159
int** ppi = new int*;
+149
<?php
@require_once('something-that-doesnot-exists.php');
echo 'My etogo uzhe ne prochitaem((';
?>
Баг ПХП. 4 часа искал методом научного echo. Ошибки не выдает, завершает выполнение как будто вызвали exit() or die(). Растолкуйте в чем суть?
Но всё-таки виновати разработчики CodeIgniter. Они нарушили принцип KISS (keep it simple). Я например, никогда не использую @ (даже незнаю к чему этот отросток).
+164
// set admin mode
switch (true) {
case $nc_core->inside_admin:
$nc_core->admin_mode = true;
break;
case !$passed_thru_404 && isset($posting): // add (edit) action
$nc_core->admin_mode = $admin_mode;
break;
case !$passed_thru_404: //front-office
$nc_core->admin_mode = true;
break;
case $passed_thru_404:
$nc_core->admin_mode = false;
break;
default:
$nc_core->admin_mode = false;
}
/netcat/require/index.php
Что они там курят, что у них настолько извилины выпрямляются?!
+101
if IntToStr(n) = '2' then begin
/// Еще куча говнокода
end;
Устроился я тут работать в одну компанию... Начинаю серию публикаций... Название компании пока не буду озвучивать - еще уволят нах...
Начнём с чего-нибудь простенького :)
+160.4
<?php
$form = new Validator;
$form
->newString(Request::get('nickname'));
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\Length(4, 16),
new FW\Rules\RegExp('/^[a-z]+$/i')
);
->newString(Request::get('password'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\MinLength(3),
new App\Rules\PasswordStrength(40)
);
->newString(Request::get('confirm'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\Equals(Request::get('password'))
)
->newString(Request::get('email'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\ValidEmail(Request::get('email'))
);
if ($form->isValid()) {
reg_user(Request::get('nickname'), Request::get('password'), Request::get('email'));
} else {
print_r($form->getErrors());
}
Народ ёбнулся на ООП
0
if (this.$arg0 == 'inc') this.$ret = this.$math = args[0] + 1;
if (this.$arg0 == 'dec') this.$ret = this.$math = args[0] - 1;
if (this.$arg0 == 'div') this.$ret = this.$math = args[0] / args[1];
if (this.$arg0 == 'ceil') this.$ret = this.$math = Math.ceil(args[0]);
if (this.$arg0 == 'floor') this.$ret = this.$math = Math.floor(args[0]);
if (this.$arg0 == 'sqrt') this.$ret = this.$math = Math.sqrt(args[0]);
if (this.$arg0 == 'exp') this.$ret = this.$math = Math.exp(args[0]);
if (this.$arg0 == 'log') this.$ret = this.$math = Math.log(args[0]);
if (this.$arg0 == 'sin') this.$ret = this.$math = Math.sign(args[0]);
if (this.$arg0 == 'log10') this.$ret = this.$math = Math.log10(args[0]);
if (this.$arg0 == 'cos') this.$ret = this.$math = Math.cos(args[0]);
if (this.$arg0 == 'tan') this.$ret = this.$math = Math.tan(args[0]);
if (this.$arg0 == 'acos') this.$ret = this.$math = Math.acos(args[0]);
if (this.$arg0 == 'atan') this.$ret = this.$math = Math.atan(args[0]);
if (this.$arg0 == 'round') this.$ret = this.$math = Math.round(args[0]);
if (this.$arg0 == 'atan2') this.$ret = this.$math = Math.atan2(args[0]);
Исходный код интерпретатора компилятора (!) Языка Программирования «AsmX».
https://github.com/langprogramming-AsmX/AsmX/blob/main/compiler.js#L215