- 1
- 2
- 3
- 4
require_once("cfg.php");
session_start();
session_unset();
session_destroy();
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+161.2
require_once("cfg.php");
session_start();
session_unset();
session_destroy();
первые 4 строки файла отвечающие за вход в админку. и далее в таком же духе
+143.8
l:
start %0
goto l
Полезный батник. Используется во время войны. Окна вылетают.
+153.1
$month = ($_POST['teh_month'] < 10 ? "0".$_POST['teh_month'] : $_POST['teh_month']);
$day = ($_POST['teh_day'] < 10 ? "0".$_POST['teh_day'] : $_POST['teh_day']);
$hour = ($_POST['teh_hour'] < 10 ? "0".$_POST['teh_hour'] : $_POST['teh_hour']);
$minute = ($_POST['teh_minute'] < 10 ? "0".$_POST['teh_minute'] : $_POST['teh_minute']);
$second = ($_POST['teh_second'] < 10 ? "0".$_POST['teh_second'] : $_POST['teh_second']);
$time=$day.".".$month.".".$_POST['teh_year']." ".$hour.":".$minute.":".$second;
мое очень старое поделие :)
+155
$output_array = array();
foreach( $list as $key => $value ) {
if( $a >= $GLOBALS['start'] && ($a - $GLOBALS['start'] < $GLOBALS['limit'] )) {
$output_array[$key] = $value;
}
$a++;
}
$list = $output_array;
Вдогонку к №1727. Аналог array_splice в стороннем компоненте к Joomla!
+127
if (CProducts.UpdateProductByPartNumber(row.Cells[2].Text, row.Cells[3].Text, Convert.ToDecimal(row.Cells[4].Text), curId, pgId, vendId) != -1)
{
// ...
}
Эх... первый месяц работы программистом я думал что экономить место - это круто :о)
+83.6
procedure TForm1.WMNCHitTest(var M: TWMNCHitTest);
var
P: TPoint;
Left, Right, Top, Bottom: Boolean;
begin
P := ScreenToClient(SmallPointToPoint(M.Pos));
Left := (P.X < 5) and not (akLeft in Anchors);
Right := (P.X > Width - 5) and not (akRight in Anchors);
Top := (P.Y < 5) and not (akTop in Anchors);
Bottom := (P.Y > Height - 5) and not (akBottom in Anchors);
M.Result := HTCLIENT;
if Left then
if Top then
M.Result := HTTOPLEFT
else
if Bottom then
M.Result := HTBOTTOMLEFT
else
M.Result := HTLEFT
else
if Right then
if Top then
M.Result := HTTOPRIGHT
else
if Bottom then
M.Result := HTBOTTOMRIGHT
else
M.Result := HTRIGHT
else
if Top then
M.Result := HTTOP
else
if Bottom then
M.Result := HTBOTTOM;
end;
изменяем размеры формы с BorderStyle = bsNone.
−115.5
#Region "КОНСТАНТЫ ЭЛЕМЕНТОВ И АТТРИБУТОВ EXCEL"
Public Const STYLE_DEFAULT As String = "Default"
Public Const STYLE_ROW_VAC As String = "RvaC"
Public Const STYLE_COLUMN As String = "Column"
Public Const STYLE_f7I_bN_vaC_haL_n As String = "f7IbNvaChaL"
Public Const STYLE_f7_bN_vaC_haL_nS As String = "f7bNvaChaLnS"
Public Const STYLE_f7_bN_vaC_haR_nS As String = "f7bNvaChaRnS"
Public Const STYLE_f7U_bl1r1Dt2_vaC_haL_n As String = "f7Ubl1t2r1DvaChaL"
Public Const STYLE_f7_bl1Dr1t2_vaC_haL_n As String = "f7bl1Dr1t2vaChaL"
Public Const STYLE_f7_br1D_vaC_haL_n As String = "f7br1DvaChaL"
Public Const STYLE_f7_bl1Dr1_vaC_haL_nP As String = "f7bl1Dr1vaChaLnP"
Public Const STYLE_f12B_bN_vaC_haL_n As String = "f11BbNvaChaL"
Public Const STYLE_f12_bN_vaC_haL_n As String = "f11bNvaChaL"
Public Const STYLE_f7_bN_vaT_haL_n As String = "f7bNvaThaL"
Public Const STYLE_f12B_bl1r1t2_vaC_haL_n As String = "f11Bbl1r1t2vaChaL"
Public Const STYLE_f7B_bN_vaC_haR_nS As String = "f7BvaChaRnS"
Public Const STYLE_f7_bN_vaC_haC_n As String = "f7bNvaChaC"
Public Const STYLE_f7B_bN_vaC_haL_nS As String = "f7BbNvaChaLnS"
Public Const STYLE_f7B_bN_vaC_haC_n As String = "f7BbNvaChaC"
Public Const STYLE_f7B_bl1r1t1b1_vaC_haC_n As String = "f7Bbl1r1t1b1vaChaC"
Public Const STYLE_f7B_bl1_vaC_haL_n As String = "f7bl1vaChaL"
Public Const STYLE_f7B_bt2_vaC_haL_nS As String = "f7Bbt2vaChaLnS"
Public Const STYLE_f7B_bt2_vaC_haC_n As String = "f7Bbt2vaChaC"
Public Const STYLE_f7B_bt2_vaC_haR_nS As String = "f7Bbt2vaChaRnS"
Public Const STYLE_f7_bl1r1t2b1_vaC_haC_nS As String = "f7bl1r1t2b1vaChaCnS"
Public Const STYLE_f7_bl1r1t2_vaC_haR_nS As String = "f7bl1r1t2vaChaRnS"
Public Const STYLE_f7B_bl1r1t2b1_vaC_haR_nS As String = "f7Bbl1r1t2b1vaChaRnS"
Public Const STYLE_f7_bl1r1t2b1_vaC_haR_nS As String = "f7bl1r1t2b1vaChaRnS"
Public Const STYLE_f7_bl1r1b1_vaC_haR_nS As String = "f7bl1r1b1vaChaRnS"
Public Const STYLE_f7B_bl1r1t1b1_vaC_haR_nS As String = "f7Bbl1r1t1b1vaChaRnS"
Public Const STYLE_f7_bl1r1t1b1_vaC_haR_nS As String = "f7bl1r1t1b1vaChaRnS"
Public Const STYLE_f7U_bl1r1t1b1_vaC_haL_n As String = "f7Ubl1r1t1b1vaChaL"
Public Const STYLE_f7I_bl1r1t1b1_vaC_haC_n As String = "f7Ibl1r1t1b1vaChaC"
Public Const STYLE_f7_bl1r1t1b1_vaC_haL_nS As String = "f7bl1r1t1b1vaChaLnS"
Public Const STYLE_f7_bl1r1t1b1_vaC_haC_nS As String = "f7bl1r1t1b1vaChaCnS"
Public Const STYLE_f7I_bl1r1t1b1_vaC_haR_n As String = "f7Ibl1r1t1b1vaChaR"
Public Const STYLE_f7_bl1r1t2b1_vaC_haC_nN As String = "f7bl1r1t2b1vaChaCnN"
Public Const STYLE_f7_bl1r1t1b1_vaC_haC_nN As String = "f7bl1r1t1b1vaChaCnN"
Public Const STYLE_f7B_bl1r1t2b2_vaC_haL_nS As String = "f7Bbl1r1t2b2vaChaLnS"
Public Const STYLE_f7_bl1r1t2b2_vaC_haC_nS As String = "f7bl1r1t2b2vaChaCnS"
Public Const STYLE_f7B_bl1r1t2b2_vaC_haR_nS As String = "f7Bbl1r1t2b2vaChaRnS"
Public Const STYLE_f7B_bl1r1t1b1_vaC_haL_nS As String = "f7Bbl1r1t1b1vaChaLnS"
Public Const STYLE_f12B_bN_vaC_haR_nS As String = "f12BbNvaChaRnS"
Public Const STYLE_f12_bN_vaC_haC_nS As String = "f12bNvaChaCnS"
Public Const STYLE_f7I_bl1r1t1b1_vaC_haL_nS As String = "f7Ibl1r1t1b1vaChaLnS"
Public Const STYLE_f7I_bl1r1t1b1_vaC_haC_nN As String = "f7Ibl1r1t1b1vaChaCnN"
Public Const STYLE_f7B_bl1r1t1b1_vaC_haC As String = "f7BvaChaC" 'STYLE_f7B_bl1r1t1b1_vaC_haC_n ' "f7Bbl1r1t1b1vaChaC"
Public Const STYLE_f7B_bl1r1t1b1_vaC_haL As String = "f7BvaChaL" '"f7Bbl1r1t1b1vaChaL"
Public Const STYLE_f7_bl1r1t1b1_vaC_haL As String = "f7vaChaL" '"f7bl1r1t1b1vaChaL"
Public Const STYLE_f7_bl1r1t1b1_vaT_haLW As String = "f7vaThaLW" '"f7bl1r1t1b1vaChaL"
#End Region
Трудно поверить, но этот кусок кода написан живым человеком. И, что самое странное, этот человек считал, что использовать такие константы очень удобно.
+151.6
var addEventListener = function() {
// Если браузер IE:
if (window.attachEvent)
// Возвращаем функцию для IE:
return function(element, event, callback) {
// Фиксуем callback, чтоб установить правильный
// this, и передавать объект события первым параметром:
callback.__callbackfix = function() {
callback.call(element, window.event);
};
// Устанавливаем обработчик (не забываем про "on")
return element.attachEvent("on" + event, callback.__callbackfix);
}
// Если браузер W3C-совместим:
if (window.addEventListener)
// Возвращаем функцию без фиксов:
return function(element, event, callback) {
// Последний параметр всегда false, для совместимости с IE:
return element.addEventListener(event, callback, false);
}
}();
Найдено на просторах рунета. А теперь пробуем повесить событие на window.
+151.9
$_SEARCH_DATA= JRequest::get($_GET);
$arr_keys=array_keys($_SEARCH_DATA);
for($i=0;$i<count($arr_keys);$i++){
$arr_data[$i]=$_SEARCH_DATA[$arr_keys[$i]];
}
$arr_form=array_combine($arr_keys,$arr_data);
+68
// right now. I can't find how to make fucking @DirectLink
// to necessary book, therefore it'll be a cocksucking crutch.
// from eveel, with love :)
writer.attribute("href",
"?component=%24DirectLink&page=Home&service=direct&session=T&sp=" +
i);
Гоняем Tapestry «на посмотреть».
Действительно, понять сходу каким образому внутри компонента использовать другой компонент (тот же DirectLink) у меня не получилось. Вообще, вопрос в силе.