1. ActionScript / Говнокод #10222

    −168

    1. 1
    staticDataTemp = com.adobe.serialization.json.JSON.encode(com.adobe.serialization.json.JSON.decode(e.target.data));

    kyzi007, 08 Мая 2012

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

    +70

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/compare.tpl')) {
    	$this->template = $this->config->get('config_template') . '/template/product/compare.tpl';
    } else {
    	$this->template = 'default/template/product/compare.tpl';
    }

    Спешите видеть в конце каждого контроллера OpenCart. Ох уж это MVC ради MVC...

    telnet, 08 Мая 2012

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

    +73

    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
    [production]
    phpSettings.display_startup_errors = 0
    phpSettings.display_errors = 0
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    appnamespace = "Application"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.frontController.params.displayExceptions = 0
    
    resources.log.khuy.writerName = "Firebug"
    
    resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/../library/Zend/View/Helper"
    resources.view.helperPath.My_View_Helper = APPLICATION_PATH "/views/helpers"
    [staging : production]
    
    [testing : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    
    [development : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    resources.frontController.params.displayExceptions = 1

    __proto__, 08 Мая 2012

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

    +88

    1. 1
    2. 2
    3. 3
    4. 4
    if( $tpl_name == '' || ! file_exists( $this->dir . DIRECTORY_SEPARATOR . $tpl_name ) ) {
    			return "Отсутствует файл шаблона: " . $tpl_name ;
    			return false;
    		}

    dle

    trororom, 08 Мая 2012

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Controller::Controller(QObject *parent)
      : QObject(parent) {
      connect( &rcvr, SIGNAL(deviceMessage(QString,QString,QString,QString,QString,QString,QString,QString)),
               this,   SLOT(processMessage(QString,QString,QString,QString,QString,QString,QString,QString)) );
    }

    По порядку: таймштамп, домен, хост, логон, вендор флешки, модель, ревизия, серийник. Задвинул на полном серьёзе ))

    niko, 08 Мая 2012

    Комментарии (13)
  6. ActionScript / Говнокод #10215

    −159

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    appendExclamation("one")("two")("three")("four")("five");
    function appendExclamation(str:String):Function{
      trace(str + "! ");
      return appendExclamation;
    }
    /* outputs:
    one!
    two!
    three!
    four!
    five!
    */

    как-то натолкнулся на одном из блогов

    lammar, 08 Мая 2012

    Комментарии (9)
  7. ActionScript / Говнокод #10214

    −155

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public function initCounter():void
    {
    	_timeDisplayer.text = (_type == COUNT) ? "00:00" : ((_timeLimit < 10) ? "0" + _timeLimit.toString() + ":00" : _timeLimit.toString() + ":00");
    	_seconds = (_type == COUNT) ? 0 : 60;
    	_minutes = (_type == COUNT) ? 0 : _timeLimit;
    	_counterCompleted = false;
    }

    еще одно тернарное извращение:)

    lammar, 08 Мая 2012

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

    +75

    1. 1
    2. 2
    3. 3
    4. 4
    require( "./configuration.php" );
    include( "./include.php" );
    $returned = @( );
    if ( ( $returned ) != @( "harper" ) )

    cthulhu25, 07 Мая 2012

    Комментарии (7)
  9. Java / Говнокод #10211

    +86

    1. 1
    2. 2
    3. 3
    int createStageCycles = 0;
    createStageCycles = Integer.parseInt(strCycle);
    int nextVal = new Integer(createStageCycles) + 1;

    int двойного отжима

    zloizerg, 07 Мая 2012

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

    +80

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $F = 0;
    if ($F == "0") {
    include ("index-bd.php");
    }
    else {
    include ("../index-bd.php");
    };

    И так подключатся все файлы в проекте.

    Evil_Wolf, 07 Мая 2012

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