- 1
- 2
define(ADS_ACTIVE_TIME, '+1 month');
$active = date('d.m.Y H:i:s', strtotime(ADS_ACTIVE_TIME, strtotime(date('d.m.Y H:i:s'))));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+52
define(ADS_ACTIVE_TIME, '+1 month');
$active = date('d.m.Y H:i:s', strtotime(ADS_ACTIVE_TIME, strtotime(date('d.m.Y H:i:s'))));
Коммерческий проект. Про time() мы не слышали, похоже...
+125
if (this.Game.GraphicsDevice != null)
{
DrawBaseTile(sb);
}
DrawBaseTile(sb);
Надо больше спать...
+134
try
{
Bytes = Encoding.Default.GetBytes(ImageString);
MemStream.Write(Bytes, 0, Bytes.Length);
try
{
CaptchaPictureBox.Image = Image.FromStream(MemStream);
CaptchaPictureBox.Enabled = true;
CaptchaTextBox.Enabled = true;
CaptchaBtn.Enabled = true;
CaptchaTextBox.Focus();
Result = true;
}
catch
{
}
}
catch
{
}
http://code.google.com/p/2chwipe/source/browse/trunk/MainForm.cs
−18
return StrLen((*i).second);
В точку.
+66
/**
*
* check for collection object
* @access public
* @param string $session_path
* @param string $session_name
* @return boolean
*/
public function open($session_path, $session_name)
{
$result = false;
if ($this->__mongo_collection != NULL)
{
$result = false;
}
return $result;
}
Недавно искал класс для хранения сессий в базе данных и нашел его тут
http://www.phpclasses.org/browse/file/34711.html (для тех кто не видит смотрим тут http://pastebin.com/xuQav8nD)
При внимательном просмотре нашел этот кусок кода :)
+132
function rechargePubSession(age,sexe)
{
var url_pub_ban = "publicite_banniere";
var url_pub_sky = "publicite_skyscrapper";
var ext;
if (age >0)
{
if (age < 18)
ext="_A";
else if (age < 33)
ext="_G";
else if (age >= 33)
ext="_E";
if (ext!="")
{
if (sexe == "F")
ext+="_F";
else if (sexe == "M")
ext+="_M";
if (sexe=="M" || sexe=="F")
{
url_pub_ban += ext;
url_pub_sky += ext;
}
}
}
url_pub_ban+=".html";
url_pub_sky+=".html";
frame_pub_banniere.document.location= url_pub_ban;
frame_pub_droite.document.location=url_pub_sky;
}
http://ru.akinator.com
+57
// Сортируем по дате {
foreach ($arfiles as $key => $value)
{
$data = file_get_contents($fullcatpage.$arfiles[$key]);
$pubdata_text = articlesparam('pubdate',$data);
$arfiles[$key] = $pubdata_text . '-' . $value;
}
sort($arfiles);
foreach ($arfiles as $key => $value)
{
$arfiles[$key] = substr($value, 11);
}
// }
1. прикрутить префикс
2. отсортировать
3. открутить префикс
+69
$file[] = $_FILES[''.$key.''];
Подобное "приведение типов (?)" для $key просто убивает. Размазано по всему проекту...
−84
def self.allow_some_behaviour?
# better safe than sorry.
bool = !false ? !false : !!false
# type checking
if bool
# short circuit just in case
return !true;
elsif !bool
return !false
end
end
найдено в реальном проекте, работало в течении года где то. зачем это сделано - непонятно. почему не выпилили, тоже неясно.
+69
if ($autor->name != 'webred') {
$role = ",<br />Народный корреспондент";
if(isset($user->roles['3']) || isset($user->roles['5']) || isset($user->roles['6']))
{
$role = ",<br />Редактор";
if(isset($user->roles['7']))
{
$role = ",<br />Корреспондент";
}
//глред
if(isset($user->roles['8']))
{
$role = ",<br />Главный редактор";
}
//глобоз
if(isset($user->roles['9']))
{
$role = ",<br />Обозреватель";
}
//шефред
if(isset($user->roles['10']))
{
$role = ",<br />Шеф-редактор";
}
if(isset($user->roles['12']))
{
$role = ",<br />Спортивный обозреватель";
}
if(isset($user->roles['11']))
{
$role = ",<br />Редакция сайта";
}
//блоггер
if(isset($user->roles['13']))
{
$role = ",<br />Блоггер";
}
}
Как вам такое?:)