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

    В номинации:
    За время:
  2. Куча / Говнокод #23302

    −15

    1. 1
    github.com/mpak2/mpak.su/tree/master/include/mail

    В mpak завезли composer.json

    d_fomenok, 27 Августа 2017

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

    +2

    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
    var L = {
                'Рђ': 'A',
                'Р°': 'a',
                'Р‘': 'B',
                'Р±': 'b',
                'Р’': 'V',
                'РІ': 'v',
                'Р“': 'G',
                'Рі': 'g',
                'Р”': 'D',
                'Рґ': 'd',
                'Р•': 'E',
                'Рµ': 'e',
                'РЃ': 'Yo',
                'С‘': 'yo',
                'Р–': 'Zh',
                'Р¶': 'zh',
                'Р—': 'Z',
                'Р·': 'z',
                'И': 'I',
                'Рё': 'i',
                'Р™': 'Y',
                'Р№': 'y',
                'Рљ': 'K',
                'Рє': 'k',
                'Р›': 'L',
                'Р»': 'l',
                'Рњ': 'M',
                'Рј': 'm',
                'Рќ': 'N',
                'РЅ': 'n',
                'Рћ': 'O',
                'Рѕ': 'o',
                'Рџ': 'P',
                'Рї': 'p',
                'Р ': 'R',
                'СЂ': 'r',
                'РЎ': 'S',
                'СЃ': 's',
                'Рў': 'T',
                'С‚': 't',
                'РЈ': 'U',
                'Сѓ': 'u',
                'Р¤': 'F',
                'С„': 'f',
                'РҐ': 'Kh',
                'С…': 'kh',
                'Р¦': 'Ts',
                'С†': 'ts',
                'Р§': 'Ch',
                'С‡': 'ch',
                'РЁ': 'Sh',
                'С€': 'sh',
                'Р©': 'Sch',
                'С‰': 'sch',
                'РЄ': '',
                'СЉ': '',
                'Р«': 'Y',
                'С‹': 'y',
                'Р¬': "",
                'СЊ': "",
                'Р­': 'E',
                'СЌ': 'e',
                'Р®': 'Yu',
                'СЋ': 'yu',
                'РЇ': 'Ya',
                'СЏ': 'ya'
            };

    Pavel-Pronskiy, 23 Августа 2017

    Комментарии (4)
  4. Python / Говнокод #23288

    +2

    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
    #!/usr/bin/env python
    
    import jinja2
    
    import contextlib
    import os.path
    import shutil
    import subprocess
    import sys
    import tempfile
    
    
    @contextlib.contextmanager
    def rm_dir(d):
        yield d
        shutil.rmtree(d)
    
    
    def main():
        if len(sys.argv) < 2:
            return
    
        if os.path.basename(sys.argv[1]) != "compile":
            subprocess.call(sys.argv[1:])
            return
    
        command = sys.argv[1:]
        preprocessed_files = []
    
        with rm_dir(tempfile.mkdtemp()) as tmpdir:
            print "Temp dir is", tmpdir
    
            while len(command) > 0 and not command[-1].startswith("-") and command[-1].endswith(".go"):
                tmpfile = os.path.join(tmpdir, str(len(command)) + ".go")
    
                with open(command[-1]) as input:
                    with open(tmpfile, "wb") as preprocessed:
                        print "Preprocess", command[-1], "into", tmpfile
                        preprocessed.write(jinja2.Template(input.read()).render())
    
                preprocessed_files.append(tmpfile)
                command.pop()
    
            subprocess.call(command + preprocessed_files)
    
    
    if __name__ == "__main__":
        main()

    Прикручиваем шаблонизатор jinja к го, чтобы копипастить с комфортом. Использовать так:

    go build -toolexec '/path/to/preprocess.py' package_na_go

    123123123, 22 Августа 2017

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

    0

    1. 1
    2. 2
    3. 3
    Телефон Страйкера: +79653583864
    Скоро на всех гей-порталах страны.
    Админ, можешь уже выбрасывать симку.

    strtr, 31 Июля 2017

    Комментарии (4)
  6. Си / Говнокод #23211

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    Сишечные строки для printf-подобной параши из прошивки ESP8266 (для веб-сервера):
    ....
    method="POST">Login: <INPUT size=10 NAME='login' value="%s"> Password: <INPUT size=10 NAME='pass' value="%s"></td></tr><br><INPUT TYPE='checkbox' NAME='fls'%s> Full Security.
    <input type="hidden" name="st" value=5><br>%s
    <hr><b>Config module:</b><br><div class="spH2"></div><form method="GET">Host name: <INPUT size=12 NAME='hn' value="%s">
    <input type="hidden" name="st" value=7><br>%s
    <hr><b>WiFi options:</b><br><div class="spH2"></div><form method="GET"><input type="radio" name="sm" value="0" %s>Station mode.<input type="radio" name="sm" value="7" %s>AP mode.<br>AP name: <input size=20 name="stname" value="%s"> <br>AP pass: <input size=20 type='password' name="stpass" value="%s"><br>
    <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>%s</title><meta http-equiv="REFRESH" content="60"><meta name="viewport" content="width=480" /><meta name="mobile-web-app-capable" content="yes" /><link rel="stylesheet" href="main.css"></head><body><br><div style="text-align: center"><div style="display: inline-block"><div class="name fll">%s<div class="www">MaksMS <a href="http://wifi-iot.com" target="_blank">wifi-iot.com</a><br>

    ... и никакого пхп
    http://wifi-iot.com/ вот тут можно генерировать такие говнопрошивки

    j123123, 23 Июля 2017

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public bool CheckBool(string value)
           {
               value = value.ToLower();
               return !string.IsNullOrEmpty(value) && (value == "on" || value == "yes" || value == "1") ? true : false;
           }

    another variant ;D

    selicate, 14 Июля 2017

    Комментарии (4)
  8. Си / Говнокод #23180

    +2

    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
    #include <stdint.h>
    #include <stdio.h>
    
    char a[] = {35,105,110,99,108,117,100,101,32,60,115,116,100,105,110,116,46,104,62,10,35,105,110,99,108,117,100,101,32,60,115,116,100,105,111,46,104,62,10,10,99,104,97,114,32,97,91,93,32,61,32,123,0,125,59,10,10,105,110,116,32,109,97,105,110,40,118,111,105,100,41,10,123,10,32,32,105,110,116,32,98,59,10,32,32,98,32,61,32,112,114,105,110,116,102,40,34,37,115,34,44,32,97,41,59,10,32,32,102,111,114,32,40,99,104,97,114,32,42,105,32,61,32,97,59,32,105,32,60,32,97,32,43,32,115,105,122,101,111,102,40,97,41,59,32,105,43,43,41,10,32,32,123,10,32,32,32,32,112,114,105,110,116,102,40,34,37,105,44,34,44,32,42,105,41,59,10,32,32,125,10,32,32,112,114,105,110,116,102,40,34,37,115,34,44,32,97,43,98,43,49,41,59,10,32,32,114,101,116,117,114,110,32,48,59,10,125,10,};
    
    int main(void)
    {
      int b;
      b = printf("%s", a);
      for (char *i = a; i < a + sizeof(a); i++)
      {
        printf("%i,", *i);
      }
      printf("%s", a+b+1);
      return 0;
    }

    куайн на сишечке

    j123123, 12 Июля 2017

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

    −3

    1. 1
    2. 2
    Камерунские нигеры ебут админа этого сайта в четыре ствола; но, что любопытно, нельзя сказать, чтобы это ему как-то прямо уж так-таки и не нравилось.
    Извиваться-то ужом он, положим, извивается; да только вопли из его глотки летят далеко не страдальческие...

    AnalPerOral, 12 Июля 2017

    Комментарии (4)
  10. Python / Говнокод #23168

    +2

    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
    class StreamRailBase:
        __metaclass__ = ABCMeta
    
        def __init__(self): pass
    
        # @abstractmethod
        # def create_connection(self): pass
        #
        # @abstractmethod
        # def send_to_sr(self, method, path, params=None): pass
    
        # @abstractmethod
        # def get_advertisers(self): pass
        #
        # @abstractmethod
        # def get_targeting_conditions(self, env, geos, os, size, white_list, black_list): pass
        #
        # @abstractmethod
        # def create_ad_source(self, name, price, partner, tag_url, env, geos, os, size, req_cap, imp_cap, white_list=None, black_list=None): pass
        #
        # @abstractmethod
        # def create_sr_tag(self, tag_instance): pass
        #
        # @abstractmethod
        # def create_domain_list(self, f, list_type, adsource_name): pass
        #
        # @abstractmethod
        # def activate_adsource(self, adsource_id): pass
        #
        # @abstractmethod
        # def deactivate_adsource(self, adsource_id): pass
        #
        # @abstractmethod
        # def set_caps(self, params, new_req_cap, new_imp_cap): pass
        #
        # @abstractmethod
        # def set_geos(self, params, new_geos): pass
        #
        # @abstractmethod
        # def edit_domain_list(self, f, list_id): pass
        #
        # @abstractmethod
        # def set_list(self, params, new_list, list_type): pass
        #
        # @abstractmethod
        # def set_size(self, params, size): pass
        #
        # @abstractmethod
        # def edit_adsource(self, tag_instance, form_data): pass
        #
        # @abstractmethod
        # def create_new_partner(self, name): pass
        #
        # @abstractmethod
        # def sync_tag(self, tag_instance): pass
        #
        # @abstractmethod
        # def add_new_tag_to_template(self, tag_name, price, tag_id, adv_id): pass

    В человеке умер рахитектор, и в отчаянии, он закомитил эту хуйню в мастер.

    wvxvw, 09 Июля 2017

    Комментарии (4)
  11. Си / Говнокод #23155

    0

    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
    void SetTitleBarIcon(HWND hDlg)
    {
    	int i16, s16, s32;
    	HICON hSmallIcon, hBigIcon;
    
    	// High DPI scaling
    	i16 = GetSystemMetrics(SM_CXSMICON);
    	// Adjust icon size lookup
    	s16 = i16;
    	s32 = (int)(32.0f*fScale);
    	if (s16 >= 54)
    		s16 = 64;
    	else if (s16 >= 40)
    		s16 = 48;
    	else if (s16 >= 28)
    		s16 = 32;
    	else if (s16 >= 20)
    		s16 = 24;
    	if (s32 >= 54)
    		s32 = 64;
    	else if (s32 >= 40)
    		s32 = 48;
    	else if (s32 >= 28)
    		s32 = 32;
    	else if (s32 >= 20)
    		s32 = 24;
    
    	// Create the title bar icon
    	hSmallIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s16, s16, 0);
    	SendMessage (hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon);
    	hBigIcon = (HICON)LoadImage(hMainInstance, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, s32, s32, 0);
    	SendMessage (hDlg, WM_SETICON, ICON_BIG, (LPARAM)hBigIcon);
    }

    https://github.com/pbatard/rufus/blob/92d046e663811fd922262f1f347ad2ebe8e09b97/src/stdlg.c#L1607-L1639

    j123123, 05 Июля 2017

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