- 1
- 2
- 3
- 4
- 5
- 6
****@****:~$ python
>>> import this
The Zen of Python, by Tim Peters
<....>There should be one-- and preferably only one --obvious way to do it.<...>
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−107
****@****:~$ python
>>> import this
The Zen of Python, by Tim Peters
<....>There should be one-- and preferably only one --obvious way to do it.<...>
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
preferably only one
+129
CN-1489: Commit tests to isolate the bug (sadly, they pass)
+164
// В шаблоне вот так:
<DIV class="tel"><? include ("/home/***/www/inc/calend.php"); ?><BR>
// А в файле вот так:
<?
$calend = array(
"17.05.2014",
"18.05.2014",
"24.05.2014",
"25.05.2014",
"31.05.2014",
"01.06.2014",
"07.06.2014",
"08.06.2014",
"12.06.2014",
"13.06.2014",
"14.06.2014",
"15.06.2014",
"21.06.2014",
"22.06.2014",
"28.06.2014",
"29.06.2014",
"05.07.2014",
"06.07.2014",
"12.07.2014",
"13.07.2014",
"19.07.2014",
"20.07.2014",
"26.07.2014",
"27.07.2014",
"02.08.2014",
"03.08.2014",
"09.08.2014",
"10.08.2014",
"16.08.2014",
"17.08.2014",
"23.08.2014",
"24.08.2014",
"30.08.2014",
"31.08.2014",
"07.09.2014",
"13.09.2014",
"14.09.2014",
"20.09.2014",
"21.09.2014",
"27.09.2014",
"28.09.2014",
"04.10.2014",
"05.10.2014",
"11.10.2014",
"12.10.2014",
"18.10.2014",
"19.10.2014",
"25.10.2014",
"26.10.2014",
"01.11.2014",
"02.11.2014",
"03.11.2014",
"04.11.2014",
"08.11.2014",
"09.11.2014",
"15.11.2014",
"16.11.2014",
"22.11.2014",
"23.11.2014",
"29.11.2014",
"30.11.2014",
"07.12.2014",
"13.12.2014",
"14.12.2014",
"20.12.2014",
"21.12.2014",
"27.12.2014",
"28.12.2014"
);
if (in_array(date("d.m.Y",time()), $calend)) {
echo "(343) 266-30-54";
}
else echo '(343) 222-77-60';
?>
Это так вот происходит подмена телефона в выходные дни, да.
+156
<?php
foreach ($details->result_array() as $row) {
$name = $row['name'];
$email = $row['email'];
$avatar = $row['avatar'];
$access = $row['access'];
$notify = $row['notify'];
$notifysms = $row['notifysms'];
$mobile = $row['mobile'];
$signature = $row['signature'];
$address = $row['address'];
$city = $row['city'];
$state = $row['state'];
$zip = $row['zip'];
$country = $row['country'];
$phone = $row['phone'];
$mobile = $row['mobile'];
$external_state = $row['external_state'];
$external_auth = $row['external_auth'];
}
?>
Убивает к тому же то, что этот кусок написан в файле представления. Еще спрашивают, почему я решил уволиться :)
−120
|РАЗНОСТЬДАТ(ДАТАВРЕМЯ(1980, 1, 1), НакладнаяНаОтпускМатериалы.ДатаВозврата, ДЕНЬ) + 2444240 КАК ДатаВозврата,
Внезапно! Календарь майя
+48
#include <iostream>
#include "msg/messagehandler.h"
#include "msg/messagedispatcher.h"
#include "kukarek.h"
#include "pocpocpoc.h"
using namespace std;
class Foo : public MessageHandler
{
public:
Foo(MessageDispatcher* dispatcher):
MessageHandler(dispatcher)
{
using namespace std::placeholders;
subscribe<Kukarek>(bind(&Foo::kukarek, this, _1));
}
void foo()
{
sendMessage(PocPocPoc{5});
}
void kukarek(const Kukarek& k)
{
cout << "Foo Kukarek " << k.i << endl;
}
};
class Bar : public MessageHandler
{
public:
Bar(MessageDispatcher* dispatcher):
MessageHandler(dispatcher)
{
using namespace std::placeholders;
subscribe<PocPocPoc>(bind(&Bar::pocpocpoc, this, _1));
subscribe<Kukarek>(bind(&Bar::kukarek, this, _1));
}
void bar()
{
sendMessage(Kukarek{42});
}
void kukarek(const Kukarek& k)
{
cout << "Bar Kukarek " << k.i << endl;
}
void pocpocpoc(const PocPocPoc& p)
{
cout << "Bar PocPocPoc " << p.j << endl;
}
};
int main()
{
MessageDispatcher dispatcher;
Foo f(&dispatcher);
Bar b(&dispatcher);
cout << "Hello World!" << endl;
f.foo();
b.bar();
return 0;
}
Hello World!
Bar PocPocPoc 5
Foo Kukarek 42
Bar Kukarek 42
https://code.google.com/p/message-poc-poc-poc/
+153
// В чем смысл переменной knc?
var knc = 0;
var k_fr = parent.document.getElementById(kph);
if (k_fr) {
knc = 1;
}
Маленький кусочек говнокода.
Не сказал бы что тут что-то феноменальное, но подобная логика на всем проекте
"Мы создали переменную для проверки для того что бы проверить переменную для проверки"
+164
var id;
$(window).resize(function() {
clearTimeout(id);
id = setTimeout(doneResizing, 500);
});
function doneResizing(){
window.location.reload();
}
На странице элемент, у которого надо менять положение при ресайзе.
+161
function json2array($json){
if(get_magic_quotes_gpc()){
$json = stripslashes($json);
}
$json = substr($json, 1, -1);
$json = str_replace(array(":", "{", "[", "}", "]"), array("=>", "array(", "array(", ")", ")"), $json);
@eval("\$json_array = array({$json});");
return $json_array;
}
Нашел в спамере ВК. Переводит JSON в массив
−111
def parse(file):
if 1==1: #вырвано из другого места, лень пробелы удалять
if file:
try:
doc = ET.parse(file)
except IOError:
return HttpResponse(u'nofile')
лол