1. PHP / Говнокод #6713

    +147

    1. 1
    2. 2
    3. 3
    function index($name) {
    	return is_numeric($name)?'_'.$name:(int)substr($name,1);
    }

    универсальная функция для... угадайте, для чего?

    Lure Of Chaos, 20 Мая 2011

    Комментарии (13)
  2. Куча / Говнокод #6712

    +131

    1. 1
    http://molinos.ru/portfolio/a/1/1/

    Ждем загрузку, смотрим код. Офигеваем от 300К+ табуляций.

    ling, 20 Мая 2011

    Комментарии (13)
  3. bash / Говнокод #6711

    −134

    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
    # Fallback static file handler, now with XSendfile support.
        if not if(test -f $local_path) {
            if(! ~ $#xsendfile 0) {
                if(! ~ $#xsendfile_alternate 0)
                    XSendfileHeader='X-Accel-Redirect'
                if not
                    XSendfileHeader='X-Sendfile'
                echo $XSendfileHeader': '`{pwd}^'/'$local_path
            }
            if not
                static_file $local_path
        }
        if not if(~ $req_path /pub/* && test -f .$req_path) {
            if(! ~ $#xsendfile 0) {
                if(! ~ $#xsendfile_alternate 0)
                    XSendfileHeader='X-Accel-Redirect'
                if not
                    XSendfileHeader='X-Sendfile'
                echo $XSendfileHeader': '`{pwd}^'/'$req_path
            }
            if not
                static_file .$req_path
        }

    dukzcry, 19 Мая 2011

    Комментарии (9)
  4. PHP / Говнокод #6710

    +160

    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
    // There is an error while creating thumbnail in m or in s or in l
    						if ($creatingSError || $creatingMError || $creatingLError) {
    							// if all or two errors appear, we only display the last error message	
    							// because the errors in this case is the same
    							if ($errorMsgS != '') {
    								$creatingError = $errorMsgS;
    							}
    							if ($errorMsgM != '') {
    								$creatingError = $errorMsgM;
    							}
    							if ($errorMsgL != '') {
    								$creatingError = $errorMsgL;
    							}							// because the errors in this case is the same
    						
    							$returnFrontMessage = $creatingError;
    						} else if ($errorMsgS == '' && $errorMsgM == '' && $errorMsgL == '') {
    							$returnFrontMessage = 'Success';
    						} else if ($errorMsgS == '' && $errorMsgM == '' && $errorMsgL == 'ThumbnailExists') {
    							$returnFrontMessage = 'Success';
    						} else if ($errorMsgS == '' && $errorMsgM == 'ThumbnailExists' && $errorMsgL == 'ThumbnailExists') {
    							$returnFrontMessage = 'Success';
    						} else if ($errorMsgS == '' && $errorMsgM == 'ThumbnailExists' && $errorMsgL == '') {
    							$returnFrontMessage = 'Success';
    						} else if ($errorMsgS == 'ThumbnailExists' && $errorMsgM == 'ThumbnailExists' && $errorMsgL == '') {
    							$returnFrontMessage = 'Success';
    						} else if ($errorMsgS == 'ThumbnailExists' && $errorMsgM == '' && $errorMsgL == '') {
    							$returnFrontMessage = 'Success';
    						} else if ($errorMsgS == 'ThumbnailExists' && $errorMsgM == '' && $errorMsgL == 'ThumbnailExists') {
    							$returnFrontMessage = 'Success';
    						}

    Модуль phocagallery для joomla. Кусок кода в функции генереции превьюшек 3х разных размеров.

    somebody, 19 Мая 2011

    Комментарии (8)
  5. Python / Говнокод #6709

    −98

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    # -*- coding: cp1251 -*- 
    beer = u"бутылок пива стоят на столе. Одна упала."
    botle = 100
    for i in range(1, 100):
        print (botle-i), beer
    print u"Нету больше пива на столе :-("

    Пива не будет :-(

    Govnocoder#0xFF, 19 Мая 2011

    Комментарии (56)
  6. Куча / Говнокод #6708

    +141

    1. 1
    [uuid(CAC0EDB3-0F36-4CF2-B133-7DDB02CCD1D2)]

    Часть IDL, обратил внимание на букво-цифры в начале :)
    Just4Fun...

    JeremyW, 19 Мая 2011

    Комментарии (20)
  7. PHP / Говнокод #6707

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    // ...
    // Количество распиленных досок
    $spl = 0;
    
    // Количество использованных пакетов
    $clpz = 0;
    if ($spl === 0) {
        for ($ix = 1; $ix <= $cll; $ix++) {
            $dsk[$ix] = $dd;
        }
    }
    // ....

    Встретился вот такой код. Условие по моему тут лишнее :)

    Joo, 19 Мая 2011

    Комментарии (10)
  8. Куча / Говнокод #6706

    +134

    1. 1
    2. 2
    3. 3
    4. 4
    <h1 style="padding: 0" class="PageName">Информация для пассажира</h1>
    
    <div class="cont"><!-- p><b>Уважаемые пользователи!<br /></b>Извините, сервис продажи билетов временно приостановлен - на сервере проводятся регламентные работы. Попробуйте зайти позднее или приобрести билеты в кассах.</p>
    <hr / -->

    Продолжая тему РЖД

    Uchkuma, 19 Мая 2011

    Комментарии (8)
  9. Куча / Говнокод #6705

    +135

    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
    <!-- Баннеры после меню -->
    <!-- место № 30 -->
      <div class="banner">
        <div class="emptybanner" id="banner_30"></div>
      </div>
    
      <!-- место № 40 -->
      <div class="banner">
        <div class="emptybanner" id="banner_40"></div>
      </div>
    
      <!-- место № 50 -->
      <div class="banner">
        <div class="emptybanner" id="banner_50"></div>
      </div>
    
      <!-- место № 60 -->
      <div class="banner">
        <div class="emptybanner" id="banner_60"></div>
      </div>
    
      <!-- место № 70 -->
      <div class="banner">
        <div class="emptybanner" id="banner_70"></div>
      </div>
    
      <!-- место № 80 -->
      <div class="banner">
        <div class="emptybanner" id="banner_80"></div>
      </div>
    
      <!-- место № 90 -->
      <div class="banner">
        <div class="emptybanner" id="banner_90"></div>
      </div>

    http://ticket.rzd.ru
    Все комментарии в коде в другой кодировке.
    Это, конечно, крутая конспирация, $str =~ s/<!--.*?-->//sg; и $str =~ s#//.*?-##g; нервно курят в сторонке.

    Ну а иллюстрация тоже веселая. Пустые баннеры отаке!

    7ion, 19 Мая 2011

    Комментарии (19)
  10. PHP / Говнокод #6704

    +163

    1. 1
    substr_count(strtolower(php_uname()),'windows') ? ';' : ':')

    NetCat, такой NetCat. О существовании PATH_SEPARATOR даже и не знали.

    miraage, 19 Мая 2011

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