1. Лучший говнокод

    В номинации:
    За время:
  2. Haskell / Говнокод #29250

    +1

    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
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    {-# LANGUAGE OverloadedStrings #-}
    import qualified Data.Text.Lazy.IO as LIO
    import GHC.IO.StdHandles
    import Text.Regex.TDFA
    import qualified Text.Regex.TDFA.Text.Lazy as RL
    import Data.Array
    import qualified Data.Text.Lazy as TL
    import System.Environment
    import System.Exit
    import System.IO
    import qualified Language.C.Syntax.Constants as CC
    import Data.Char
    
    printMatch t matches i =
        let (offset, len) = matches ! i in
        let offset' = fromIntegral offset in
        let len' = fromIntegral len in
        LIO.putStr $ TL.take len' $ TL.drop offset' t
    
    printHead t matches =
        let (offset, len) = matches ! 0 in
        let offset' = fromIntegral offset in
        let len' = fromIntegral len in
        LIO.putStr $ TL.take offset' t
    
    printTrail t matches =
        let (offset, len) = matches ! 0 in
        let offset' = fromIntegral offset in
        let len' = fromIntegral len in
        LIO.putStr $ TL.drop (offset' + len') t
    
    need_capture_trail acc ".*" = (False, reverse acc)
    need_capture_trail acc [] = (True, reverse acc)
    need_capture_trail acc (c : rest) = need_capture_trail (c : acc) rest
    
    getRE :: [String] -> Either String (RL.Regex, Bool, String)
    getRE args =
        case args of
          (re_str : repl_str : _) ->
              let (trail_needed, re_str') = need_capture_trail [] re_str in
              let re_text = TL.pack $ CC.unescapeString re_str' in
              case RL.compile defaultCompOpt defaultExecOpt re_text of
                Right re ->
                    Right (re, trail_needed, CC.unescapeString repl_str)
                Left err ->
                    Left err
          _ ->
              Left "Regexp expected"
    
    -- replacement :: TL.Text -> Int -> _ -> String -> IO ()
    replacement _ _ _ [] = return ()
    replacement t n_matches matches (c : rest)
        | ord c <= n_matches = do
               printMatch t matches (ord c)
               replacement t n_matches matches rest
        | True = do
            putChar c
            replacement t n_matches matches rest
    
    exitError :: String -> IO ()
    exitError msg = do
      hPutStrLn stderr msg
      exitWith (ExitFailure 1)
    
    main :: IO ()
    main = do
        args <- getArgs
        case getRE args of
          Right (re, trail_needed, repl) -> do
              t <- LIO.hGetContents stdin
              case RL.execute re t of
                Right (Just matches) ->
                    do
                      let n_matches = snd $ bounds matches
                      -- print matches
                      printHead t matches
                      replacement t n_matches matches repl
                      if trail_needed then
                          printTrail t matches
                      else
                          return ()
                Right Nothing -> do
                    exitError "Pattern not found"
                Left err -> do
                    exitError err
          Left err -> do
             exitError err

    Текст UNIX-way утилиты fed
    Капча: p2ux

    CHayT, 25 Апреля 2026

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <? // get current season for header styling
    		$current_month = date("m");
    		if($current_month >= "03" && $current_month <= "05") $season = "spring";
    		elseif($current_month >= "06" && $current_month <= "08") $season = "spring";
    		elseif($current_month >= "09" && $current_month <= "11") $season = "autumn";
    		else $season = "winter";
      ?>

    И про теги в стиле говноБитрикса не забыли

    Lexchz2, 25 Февраля 2026

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

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    ЗарплатныйПроект = Справочники.ЗарплатныеПроекты.ПустаяCсылка(); 
    	Запрос = Новый Запрос();
    	Запрос.Текст = "ВЫБРАТЬ ПЕРВЫЕ 1
    	|	ЗарплатныеПроекты.Ссылка КАК ЗарплатныйПроект
    	|ИЗ
    	|	Справочник.ЗарплатныеПроекты КАК ЗарплатныеПроекты";
    	Если НЕ Запрос.Выполнить().Пустой() Тогда
    		Рез = Запрос.Выполнить().Выбрать();
    		Рез.Следующий(); 
    		ЗарплатныйПроект = Рез.ЗарплатныйПроект;
    	КонецЕсли;

    Муки получения зарплатного проекта.

    Bazooka, 11 Февраля 2026

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    diff -uwrd RedmiNote12/vendor_a/etc/usecaseKvManager.xml RedmiNote13/vendor_a/etc/usecaseKvManager.xml
    ...
    -            <keys_and_values StreamType="PAL_STREAM_VOIP_TX" CustomConfig="dual-mic">>
    +            <keys_and_values StreamType="PAL_STREAM_VOIP_TX" CustomConfig="dual-mic">

    Сравнил две прошивки. Это неполный пример, зато пиздец полный.

    HoBorogHuu_nemyx, 28 Января 2026

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

    +1

    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
    Новогодний оффтоп #6
    ░░░░░░░░░░░░░░░░░▐▌░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▀████▀░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▄█▀▀█▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░▄▄░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▄████▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░▄▄██╬██╬████▄▄░░░░░░░░░░░
    ░░░░░░░░▀███████╬███╬██████▀░░░░░░░░
    ░░░░░░░░░░▄▄█╬████╬█████▄▄░░░░░░░░░░
    ░░░░▄▄▄▄██╬████╬█████╬███╬██▄▄▄▄░░░░
    ░░░░░░▀▀████╬█████╬█████████▀▀░░░░░░
    ░░░░░░░░░▄█████╬██████╬███▄░░░░░░░░░
    ░░▄▄▄▄██████╬█████╬███████╬███▄▄▄▄░░
    ░░▀▀▀████╬█████╬████╬███╬██████▀▀▀░░
    ░░░░░░░░████╬████████╬██████░░░░░░░░
    ░░▄▄▄█████╬██████╬█████╬███╬███▄▄▄░░
    ▀▀▀████╬█████╬█████╬████╬███╬████▀▀▀
    ░░░░░░▀▀▀██████████████████▀▀▀░░░░░░
    ░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░

    #1: https://govnokod.ru/27188 https://govnokod.xyz/_27188
    #2: https://govnokod.ru/27893 https://govnokod.xyz/_27893
    #3: https://govnokod.ru/28484 https://govnokod.xyz/_28484
    #4: https://govnokod.ru/28896 https://govnokod.xyz/_28896
    #5: https://govnokod.ru/29066 https://govnokod.xyz/_29066

    HoBorogHuu_nemyx, 30 Декабря 2025

    Комментарии (96)
  7. Куча / Говнокод #29192

    +1

    1. 1
    Бесконечный оффтоп имени Гологуба #8

    #1: https://govnokod.ru/28992 https://govnokod.xyz/_28992
    #2: https://govnokod.ru/29053 https://govnokod.xyz/_29053
    #3: https://govnokod.ru/29075 https://govnokod.xyz/_29075
    #4: https://govnokod.ru/29110 https://govnokod.xyz/_29110
    #5: https://govnokod.ru/29127 https://govnokod.xyz/_29127
    #6: https://govnokod.ru/29140 https://govnokod.xyz/_29140
    #7: https://govnokod.ru/29170 https://govnokod.xyz/_29170

    nepeKamHblu_nemyx, 26 Октября 2025

    Комментарии (416)
  8. C# / Говнокод #29183

    +1

    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
    using Godot;
    
    namespace CW2EB.UI;
    public partial class EscQuittingLabel : Label {
    
    	Tween tween, tween2thesequel;
    	public override void _Ready(){
    		base._Ready();
    		tween = GetTree().CreateTween().SetParallel();
    		tween2thesequel = GetTree().CreateTween();
    		tween.TweenProperty(this, "theme_override_colors/font_color", new Color(1f, 1f, 1f, 1f), 1);
    		tween.TweenProperty(this, "theme_override_colors/font_shadow_color", new Color(0f, 0f, 0f, 1f), 1);
    
    		
    		tween2thesequel.TweenCallback(Callable.From(TweenStage1)).SetDelay(.25);
    		tween2thesequel.TweenCallback(Callable.From(TweenStage2)).SetDelay(.25);
    		tween2thesequel.TweenCallback(Callable.From(TweenStage3)).SetDelay(.25);
    		tween2thesequel.TweenCallback(Callable.From(TweenStage4)).SetDelay(.5);
    	}
    
    	public void TweenStage1()
    		=> Text = Tr("Quitting") + ".";
    
    	public void TweenStage2()
    		=> Text = Tr("Quitting") + "..";
    
    	public void TweenStage3()
    		=> Text = Tr("Quitting") + "...";
    
    	public void TweenStage4()
    		=> GetTree().Quit();
    }

    Как сделать постепенно появляющееся многоточие?

    GhostNoise, 29 Сентября 2025

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

    +1

    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
    /* "[...] To fix this I added a delay at the end of the function and the events
    now fire properly. Thank you for all of your help. Fixed Code:"
    */
    
    data.indexedDB.addSource = function(sourceBlob) {
    //adds source to data base
      var version = 1;
      var request = indexedDB.open("content", version);
      request.onerror = errorHandler;
      request.onsuccess = function(e) {
        db = e.target.result;
        var trans = db.transaction(["nContent"], "readwrite");
        var store = trans.objectStore("nContent");
        var request = store.put(sourceBlob);
        trans.oncomplete = function(e) {
          extron.indexedDB.getIndexedSource();
        };
    
      };
        var token = 100000;
        while(token != 0)
        {
          token = token-1;
    
        }
    };

    https://stackoverflow.com/questions/27494247/why-is-my-indexeddb-open-onsuccess-event-not-called

    ISO, 02 Сентября 2025

    Комментарии (104)
  10. bash / Говнокод #29171

    +1

    1. 1
    echo {a..z} | tr ' ' '\n' | wc -l

    настоящий инженер знает где посмотреть

    mugisbrows, 13 Августа 2025

    Комментарии (96)
  11. PHP / Говнокод #29161

    +1

    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
    48. 48
    <?php
    function real_parse_headers($data) {
        $result = [];
        foreach($data as $line) {
            $parts = explode(':', $line, 2);
            if(!isset($parts[1])) continue;
            $key = trim($parts[0]);
            $key = implode('-', array_map(function($value) {return ucfirst($value);}, explode('-', $key)));
            $result[$key] = trim($parts[1]);
        }
        return $result;
    }
    
    function real_length($from, $original_context = null) {
        $context = stream_context_create(isset($original_context) ? stream_context_get_options($original_context) : null);
        stream_context_set_option($context, 'http', 'method', 'HEAD');
        @file_get_contents($from, false, $context);
        return intval(real_parse_headers($http_response_header)['Content-Length']);
    }
    
    function real_copy($from, string $to, $context = null) {
        define('BLOCK', 8192);
        $total = real_length($from, $context);
    
        if(!isset($context)) {
            $context = stream_context_create();
        }
        $headers = stream_context_get_options($context)['http']['header'] ?? [];
        stream_context_set_option($context, 'http', 'timeout', '1.0');
        stream_context_set_option($context, 'http', 'ignore_errors', true);
    
        for($start = 0; $start < $total; $start += $length) {
            $end = $start + BLOCK;
            stream_context_set_option($context, 'http', 'header', array_merge($headers, ["Range: bytes=$start-$end"]));
            $part = @file_get_contents($from, false, $context);
            if($part === false) break;
            $length = strlen($part);
            file_put_contents($to, $part, FILE_APPEND);
        }
    }
    
    /* The real example */
    $context = stream_context_create([
        'http' => ['method' => 'GET'],
        'ssl'  => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, 'SNI_enabled' => true]
    ]);        
    
    real_copy('https://govnokod.ru/files/images/pony.jpg', 'pony.jpg', $context);

    Дрочилка для скачивания файлов с сайтов, расположенных за «Cloudflare». Теперь банановая и на «PHP»!

    nemyx, 25 Июля 2025

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