- 1
$idmenu = intval(strip_tags(trim($_REQUEST[idmenu])));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+151
$idmenu = intval(strip_tags(trim($_REQUEST[idmenu])));
+147
getOffsetPosition: function( self, hash ) {
return $( '#' + hash, self.dom.root ).offset().top - 0;
},
// 27 is a magic fix number :: +5
getNumFromStrPx: function( pixels ) {
return ( pixels.replace( 'px' , '' ) - 0 ) - 22;
},
Magic Mashrooms ;) 1200 mics => non stop and sound sucks
+150
if (preg_match(
'@^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+\@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$@',
$email
)
валидация email-а
+156
$(document).ready(function(){
$('a').on('click', function(e){
e.preventDefault();
});
otvety.google.ru/otvety/thread?tid=5c7782971303c68b
Я не знаю кто это написал, но это волшебно.
+159
function check_fio() {
var space = /^\s/;
var fio = $("#form_fio").val();
var fio_length = fio.length - 1;
if (fio[fio_length].match(space)) {
fio = fio.substring(0, fio.length - 1);
$("#form_fio").val(fio);
check_fio();
}
}
Казалось бы, удаление пробелов в конце строки, что может быть проще.
+6
float cX = (float)x / float(vp->getActualWidth());
Просто красиво))
−110
// last parameter is the setter code if value allowed to be set
#define SET_USING_CONFIG(cellSwitch,configKey,...)\
cell.cellSwitch = [(EExhibitorsListConfigItem*)[self.configInfo configItemAtIndex:0] configKey];\
if (cell.cellSwitch) {\
__VA_ARGS__;\
}
SET_USING_CONFIG(isLikesCountOn, showLikes,
cell.likesCount = exhibitor.Rating;
cell.likedByMe = exhibitor.IsRated; );
SET_USING_CONFIG(isInFavoritesOn, showFavoritesIndicator,
__weak EExhibitorCell *weakCell = cell;
cell.didChangeFavouritesStateBlock = ^(BOOL newFavState) {
[EExhibitorsListViewController updateFavoriteState:newFavState
ofExhibitor:exhibitor
inCell:weakCell];
};
);
Define master!
+140
procedure TForm1.CloseChecker1Click(Sender: TObject);
begin
Halt;
end;
procedure TForm1.CoolTrayIcon1DblClick(Sender: TObject);
begin
Form1.Show;
CoolTrayIcon1.IconVisible:=false;
end;
end.
Продолжение. Начало на http://govnokod.ru/13317, http://govnokod.ru/13318
−96
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return
interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
false ? YES : NO;
}
Продолжаем тему укуренных сравнений
+159
$sess_data = $this->getZamkadCurrent();
Opencart: /catalog/model/shipping/moscow.php line 25