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

    +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
    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
    <?php
    $action = $_REQUEST["action"];
    $subaction = $_REQUEST["subaction"];
    $id = intval($_REQUEST["id"]);
    
    if ($action == "" or $subaction == ""  or $id =="") {
        die("Go fuck yourself!");
    } elseif ($action == 'add' or $action == 'edit' or $action == 'delete') {
        if ($action == 'add') {
            if ($subaction == "character") {
    
            } elseif ($subaction == "seiyu") {
    
            } else {
                die("Go fuck yourself!");
            }
        } elseif ($action == 'edit') {
            if ($subaction == "character") {
    
            } elseif ($subaction == "seiyu") {
    
            } else {
                die("Go fuck yourself!");
            }
        } elseif ($action == 'delete') {
            if ($subaction == "character") {
    
            } elseif ($subaction == "seiyu") {
    
            } else {
                die("Go fuck yourself!");
            }
        }
    } else {
        die("Go fuck yourself!");
    }

    Вырезка из модуля DLE

    Lothbrok, 23 Сентября 2014

    Комментарии (19)
  2. Objective C / Говнокод #16751

    −393

    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
    - (void)config
    {
        self.contentView.backgroundColor = [UIColor NaviCellBgColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        UIImageView *theDisclosureView = _disclosureView;
        UILabel *theLabel = _titleLabel;
        if (self.isHighlighted)
        {
            theLabel.shadowColor = [UIColor TextShadowColor];
            theLabel.shadowOffset = CGSizeMake(0.0f, -0.5f);
            self.contentView.backgroundColor = [UIColor NaviCellBgHighlightColor];
            theLabel.textColor = [UIColor GreenTextColor];
            self.contentView.backgroundColor = [UIColor NaviCellBgHighlightColor];
            theDisclosureView.image = [UIImage imageNamed:@"Button_Disclosure_touch"];
        }
        else
        {
            theLabel.shadowColor = [UIColor TextShadowColor];
            theLabel.shadowOffset = CGSizeMake(0.0f, -0.5f);
            self.contentView.backgroundColor = [UIColor NaviCellBgHighlightColor];
            theLabel.textColor = [UIColor GreenTextColor];
            self.contentView.backgroundColor = [UIColor NaviCellBgColor];
            theDisclosureView.image = [UIImage imageNamed:@"Button_Disclosure"];
        }
    
        UIActivityIndicatorView *theIndicator = _loadingIndicator;
        if (_loading)
            [theIndicator startAnimating];
        else
            [theIndicator stopAnimating];
        
        UILabel *theTitleLabel = _titleLabel;
        theTitleLabel.textColor = [UIColor GreenTextColor];
    }

    Код вид культурного европэйця. Справжний европейский кодстайл.

    Psionic, 23 Сентября 2014

    Комментарии (0)
  3. JavaScript / Говнокод #16750

    +156

    1. 1
    jQuery("#myId"+object+".myTr"+array.length-1).append(JSON.parse(object));

    Appending result to grid table

    armengabriel, 22 Сентября 2014

    Комментарии (1)
  4. C++ / Говнокод #16749

    +51

    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
    template<typename T>
    class com_ptr {
    // ...
    
        // HRESULT ID2D1RenderTarget::CreateSolidColorBrush(
        //   const D2D1_COLOR_F &color,
        //   [out]  ID2D1SolidColorBrush **solidColorBrush   // нормальный, типизированный петух
        // );
        T ** get_init_ptr() {
            if(ptr) {
                ptr->Release();
                ptr = 0;
            }
            return &ptr;
        }
    
        // HRESULT DWriteCreateFactory(
        //   _In_   DWRITE_FACTORY_TYPE factoryType,
        //   _In_   REFIID iid,
        //   _Out_  IUnknown **factory   // петух неизвестен!
        // );
        IUnknown ** get_unknown_init_ptr() {
            return reinterpret_cast<IUnknown**>(get_init_ptr());
        }
    
        // HRESULT CoCreateInstance(
        //   _In_   REFCLSID rclsid,
        //   _In_   LPUNKNOWN pUnkOuter,
        //   _In_   DWORD dwClsContext,
        //   _In_   REFIID riid,
        //   _Out_  LPVOID *ppv    // соломка, где петух будет лежать
        // );
        void ** get_void_init_ptr() {
            return reinterpret_cast<void**>(get_init_ptr());
        }
    
    //...
    };

    Ко-ко-ком. Чтоб его за ногу.

    Xom94ok, 22 Сентября 2014

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

    +56

    1. 1
    for (size_t i=v.size()-1; i<v.size(); --i)

    unsigned в массивах не нужен, нахуй усрались длинные массивы?

    TarasB, 22 Сентября 2014

    Комментарии (24)
  6. C++ / Говнокод #16746

    +60

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    Объявление:
    bool getBorderThickness() const		{return isThinBorder;}
    
    Использование:
    size += !getBorderThickness();// + 2; 
    
    visibleAreaBegin.x = getLTPoint().x + xLeftShift + !getBorderThickness();
    visibleAreaWidth = getRBPoint().x - getLTPoint().x - xRightShift - xLeftShift - 2*!getBorderThickness();

    Умножать на буль - айм ловинг щит!

    codesuxxx, 22 Сентября 2014

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

    +163

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <?
    $text[5] .="</body>";
    $text[5] .="</html>";
    echo $text[5];
    ?>

    И вот таким вот макаром
    Наша рота солдат
    Обходит ровно за сутки
    Квадрат, квадрат, квадрат...

    Khvorostin, 22 Сентября 2014

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

    +127

    1. 1
    ['10','10','10','10'].map(parseInt)

    Результат:

    [10, NaN, 2, 3]

    someone, 22 Сентября 2014

    Комментарии (28)
  9. bash / Говнокод #16743

    −80

    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
    Devastator:ark grawl$ sass-convert -F scss -T sass -i -R *.scss
    Error: '*.scss' is not a directory
      Use --trace for backtrace.
    Devastator:ark grawl$ sass-convert -F scss -T sass -i -R .
    Devastator:partials grawl$ sass-convert -F scss -T sass -i -R *.scss
    Error: 'colors.scss' is not a directory
      Use --trace for backtrace.
    Devastator:partials grawl$ sass-convert -F scss -T sass -i -R .
        convert ./colors.scss
      overwrite ./colors.scss
    Errno::EISDIR: Is a directory - .
      Use --trace for backtrace.
    Devastator:partials grawl$ sass-convert -F scss -T sass -i -R
    Error: directory required when using --recursive.
      Use --trace for backtrace.

    sass-convert великолепен

    Grawl, 22 Сентября 2014

    Комментарии (32)
  10. Си / Говнокод #16742

    +121

    1. 1
    int main(void)

    GreenKiller, 21 Сентября 2014

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