1. JavaScript / Говнокод #2710

    +166.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function smla(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':)';}
    function smls(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='>( ';}
    function smld(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':D';}
    function smlf(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='B)';}
    function smlg(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='%)';}
    function smlh(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':(';}
    function smlj(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':o';}
    function smlw(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='^_^';}
    function smlk(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='<_<';}
    function smll(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=';)';}
    function smlq(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':p';}

    Ещё один китаец. Вставляет смайлы в текстовое поле вот таким вот кодом. Источник — http://mirtorrent.ru/css/pppm.js

    Infamous, 03 Марта 2010

    Комментарии (7)
  2. C++ / Говнокод #2709

    +73.5

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    //...                            
                                           }
    
                                        }
                                      }
                                      if(found) break;
                                    }
                                  }
                                  aStr=wcstok(NULL,m_cmdSEP);
                                }
                              }
                            }
                          }
                        }
                      }
                      else NoDeviceErrorActive(1);
                    }
                  }
                }
                else NoDeviceErrorActive(1);
              }
            }
          }
        }
      }
    //...

    Кусочек функции, сегодня наткнулся, сама функция занимает 540 строк, все методы класса -- 8000 =). И форматирование оригинальное -- не табами, а двумя пробелами =) . Мне нужно было просто посмотреть, как этот класс одну штуку делает, и я теперь сижу счастливый и думаю, как хорошо, что не мне этот код поддерживать =)

    ISith, 03 Марта 2010

    Комментарии (17)
  3. PHP / Говнокод #2708

    +168.9

    1. 1
    die('<script LANGUAGE="JavaScript">location.replace("'.$url.'");');

    Приветствуем победителя конкурса на самый извращенный редирект.

    wwwguru, 03 Марта 2010

    Комментарии (16)
  4. JavaScript / Говнокод #2707

    +159.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    function check_date() {
    	var	message = "Дата невалидна.";
    		days = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    
    	var str = $('#registration-form [name="birthday"]').val();
    
    	var m = str.match(/(\d*)\.(\d*)\.(\d*)(.*)/);
    
    	if (!m ||
    		!m[1] ||
    		!m[2] ||
    		!m[3] ||
    		m[4] ||
    		parseInt(m[2], 10) < 1 ||
    		parseInt(m[2], 10) > 12 ||
    		parseInt(m[1], 10) < 1 ||
    		parseInt(m[1], 10) > days[parseInt(m[2], 10)-1] ||
    		parseInt(m[3], 10) < 1920 ||
    		parseInt(m[3], 10) > 2000 ) {
    		tooltip($('#registration-form [name="birthday"]').get(0), message);
    	} else {
    		removett($('#registration-form [name="birthday"]').get(0));
    	}
    }

    Не очень говно, но вполне себе код.

    ixth, 03 Марта 2010

    Комментарии (23)
  5. C# / Говнокод #2706

    +965.2

    1. 1
    string k = Convert.ToString(s_kto.Text);

    s_kto - TextBox

    alex_donetsk, 03 Марта 2010

    Комментарии (5)
  6. JavaScript / Говнокод #2705

    +167.6

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    function BOOK_list() {
     document.getElementById('rbLoadedId_list').style.display='block';
     document.getElementById('rbLoadedId_blogs').style.display='none';
     document.getElementById('rbLoadedId_free').style.display='none';
     document.getElementById('rbLoadedId_add').style.display='none';
     document.getElementById('rbLoadedId_friend').style.display='none';
     document.getElementById('rbLoadedId_award').style.display='none';
    
     document.getElementById('0rbLoadedId_list').className='act';
     document.getElementById('0rbLoadedId_blogs').className='book';
     document.getElementById('0rbLoadedId_free').className='book';
     document.getElementById('0rbLoadedId_add').className='book';
     document.getElementById('0rbLoadedId_friend').className='book';
     document.getElementById('0rbLoadedId_award').className='book';
        }
    
      function BOOK_blogs() {
     document.getElementById('rbLoadedId_list').style.display='none';
     document.getElementById('rbLoadedId_blogs').style.display='block';
     document.getElementById('rbLoadedId_free').style.display='none';
     document.getElementById('rbLoadedId_add').style.display='none';
     document.getElementById('rbLoadedId_friend').style.display='none';
     document.getElementById('rbLoadedId_award').style.display='none';
    
     document.getElementById('0rbLoadedId_list').className='book';
     document.getElementById('0rbLoadedId_blogs').className='act';
     document.getElementById('0rbLoadedId_free').className='book';
     document.getElementById('0rbLoadedId_add').className='book';
     document.getElementById('0rbLoadedId_friend').className='book';
     document.getElementById('0rbLoadedId_award').className='book';
        }

    JS-табы по-китайски. Взято отсюда — http://vkurse.net.ru/js/info.js
    Это только первые 2 функции, в источнике ещё больше

    Infamous, 03 Марта 2010

    Комментарии (8)
  7. JavaScript / Говнокод #2704

    +166.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function  trim(text) {
      if (text.length == 0) {
        return text;
      }
      if (text.charAt(0) == ' ') {
        return '';
      }
      if (text.charAt(text.length-1) == ' ') {
        text = text.substring(0, text.length-1);
      }
      return text;
    }

    суровый китайский trim...

    ClintEastwood, 02 Марта 2010

    Комментарии (17)
  8. PHP / Говнокод #2703

    +145.7

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <?php
    	do{
    	$id=$test['id'];
    
    	?>
    
    ...
    
    <?php
    
    		}while($test = mysql_fetch_array($temp));
    	?>

    creatizmo, 02 Марта 2010

    Комментарии (21)
  9. JavaScript / Говнокод #2702

    +151.2

    1. 1
    <body onload="blinkAfterSearch();setTimeout('loadDummyImg()', 590000);var ex; try { startUpTasks(); } catch(ex) {}" />

    Недавно отрыл в недрах нашего проекта! Try catch в onload!! :D

    jericho, 02 Марта 2010

    Комментарии (16)
  10. JavaScript / Говнокод #2701

    +150.7

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    var Scroller = function (scroll_left,scroll_right,visible_part,scroll_part) {
    			this.scroll_right =	jQuery(scroll_left); //scroll to left
    			this.scroll_left =	jQuery(scroll_right); //scroll to right	
    			this.slider = jQuery(scroll_part); //scroll element
    			this.visible_part = jQuery(visible_part);
    			
    			this.width_slider_elements = this.slider.width();
    			this.width_slider_element = this.slider.find('li:eq(0)').width();
    			this.width_visible_part = this.visible_part.width();
    			this.temp_process = true;
    			
    			if(this.width_slider_elements < this.width_visible_part) {temp_process = false;}
    			
    			var self = this;
    			this.scroll_left.click(function()
        			{	
    					if (self.temp_process) {
    						self.temp_process = false;
    						self.slide(true);
    					}
    					return false;
    				});	
    			this.scroll_right.click(function()
    	    		{
    					if (self.temp_process) {
    							self.temp_process = false;
    							self.slide(false);
    					}
    					return false;
    				});
    			 
    			return this;
    		};
    		
    		Scroller.prototype.slide = function (side) {
    					var self = this;
    					var	shift = (self.width_visible_part - self.width_slider_element)/2;
    					var current_shift = Math.abs(self.slider.css('left').replace('px',''));
    				if (side) { //left
    					shift = (current_shift+shift+self.width_visible_part) > self.width_slider_elements ? self.width_slider_elements - current_shift - self.width_visible_part : shift;
    						self.slider.animate({left: '-='+shift+'px'}, 1000, function(){ self.temp_process = true;});
    				} else { //right
    					shift = shift > current_shift ? current_shift : shift;
    					self.slider.animate({left: '+='+shift+'px'}, 1000, function(){ self.temp_process = true;});
    				}	
    				return shift;
    		};

    Areks, 01 Марта 2010

    Комментарии (4)