1. Куча / Говнокод #26673

    0

    1. 1
    Политота #7

    #1: https://govnokod.ru/15804 (не открывается) https://govnokod.xyz/_15804/
    #2: https://govnokod.ru/19910 https://govnokod.xyz/_19910/
    #3: https://govnokod.ru/23643 https://govnokod.xyz/_23643/
    #4: (vanished) http://govnokod.xyz/_24822/
    #5: https://govnokod.ru/24868 https://govnokod.xyz/_24868
    #6: (vanished) https://govnokod.xyz/_26648/

    bagrinho, 19 Мая 2020

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

    0

    1. 1
    Просто оффтоп #7

    #1: https://govnokod.xyz/_20162 https://govnokod.ru/20162
    #2: https://govnokod.xyz/_25329 https://govnokod.ru/25329
    #3: https://govnokod.xyz/_25415 https://govnokod.ru/25415
    #4: https://govnokod.xyz/_25472 (vanished)
    #5: https://govnokod.xyz/_25693 https://govnokod.ru/25693
    #6: https://govnokod.xyz/_26649 (vanished)

    bagrinho, 19 Мая 2020

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

    +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
    IT Оффтоп #47
    
    
    #1: https://govnokod.ru/18142 https://govnokod.xyz/_18142
    #2: https://govnokod.ru/18378 https://govnokod.xyz/_18378
    #3: https://govnokod.ru/19667 https://govnokod.xyz/_19667
    #4: https://govnokod.ru/21160 https://govnokod.xyz/_21160
    #5: https://govnokod.ru/21772 https://govnokod.xyz/_21772
    #6: (vanished) https://govnokod.xyz/_24063
    #7: https://govnokod.ru/24538 https://govnokod.xyz/_24538
    #8: (vanished) https://govnokod.xyz/_24815
    #9: https://govnokod.ru/24867 https://govnokod.xyz/_24867
    #10: https://govnokod.ru/25328 https://govnokod.xyz/_25328	
    #11: (vanished) https://govnokod.xyz/_25436
    #12: (vanished) https://govnokod.xyz/_25471
    #13: (vanished) https://govnokod.xyz/_25590
    #14: https://govnokod.ru/25684 https://govnokod.xyz/_25684
    #15: https://govnokod.ru/25694 https://govnokod.xyz/_25694

    #16: https://govnokod.ru/25725 https://govnokod.xyz/_25725
    #17: https://govnokod.ru/25731 https://govnokod.xyz/_25731
    #18: https://govnokod.ru/25762 https://govnokod.xyz/_25762
    #19: https://govnokod.ru/25767 https://govnokod.xyz/_25767
    #20: https://govnokod.ru/25776 https://govnokod.xyz/_25776
    #21: https://govnokod.ru/25798 https://govnokod.xyz/_25798
    #22: https://govnokod.ru/25811 https://govnokod.xyz/_25811
    #23: https://govnokod.ru/25863 https://govnokod.xyz/_25863
    #24: https://govnokod.ru/25941 https://govnokod.xyz/_25941
    #25: https://govnokod.ru/26026 https://govnokod.xyz/_26026
    #26: https://govnokod.ru/26050 https://govnokod.xyz/_26050
    #27: https://govnokod.ru/26340 https://govnokod.xyz/_26340
    #28: https://govnokod.ru/26372 https://govnokod.xyz/_26372
    #29: https://govnokod.ru/26385 https://govnokod.xyz/_26385
    #30: https://govnokod.ru/26413 https://govnokod.xyz/_26413
    #31: https://govnokod.ru/26423 https://govnokod.xyz/_26423
    #32: https://govnokod.ru/26440 https://govnokod.xyz/_26440
    #33: https://govnokod.ru/26449 https://govnokod.xyz/_26449
    #34: https://govnokod.ru/26456 https://govnokod.xyz/_26456
    #35: https://govnokod.ru/26463 https://govnokod.xyz/_26463
    #36: https://govnokod.ru/26508 https://govnokod.xyz/_26508
    #37: https://govnokod.ru/26524 https://govnokod.xyz/_26524
    #38: https://govnokod.ru/26539 https://govnokod.xyz/_26539
    #39: https://govnokod.ru/26556 https://govnokod.xyz/_26556
    #40: https://govnokod.ru/26568 https://govnokod.xyz/_26568
    #41: https://govnokod.ru/26589 https://govnokod.xyz/_26589
    #42: https://govnokod.ru/26600 https://govnokod.xyz/_26600
    #43: https://govnokod.ru/26604 https://govnokod.xyz/_26604
    #44: https://govnokod.ru/26627 https://govnokod.xyz/_26627
    #45: https://govnokod.ru/26635 https://govnokod.xyz/_26635
    #46: (vanished) https://govnokod.xyz/_26646
    #46: (vanished) https://govnokod.xyz/_26654

    bagrinho, 19 Мая 2020

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

    +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
    public function isSpecial()
    {
        $special_ids = array(
            2222,
            3028,
            3333,
            5555,
            5702,
            6666,
            6700,
            7654,
            7777,
            8451,
            11225
        );
    
        return in_array((int)$this->getId(), $special_ids);
        //return $this->getId() == 2222 || $this->getId() == 3028 || $this->getId() == 3333 || $this->getId() == 5555 || $this->getId() == 5702;
    }

    https://github.com/wiistriker/govnokod_legacy/blob/master/modules/quoter/models/quote.php
    Рекурсивный говнокод.

    gost, 19 Мая 2020

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

    +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
    from tkinter import *
    from random import randint
    
    f = randint(2, 10)
    s = randint(2, 10)
    r = f * s
    def main_f():
        global f
        global s
        global r
        if r == int(inp.get()):
            ls.configure(text='да! Вы правы')
            f = randint(2, 10)
            s = randint(2, 10)
            r = f * s
            l.configure(text=f'сколько будет {f} * {s}?')
        else:
            ls.configure(text='нет, вы не правы')
            
            l.configure(text=f'сколько будет {f} * {s}?')
        
    
    win = Tk()
    win.title('math')
    
    l = Label(win, text=f'сколько будет {f} * {s}?')
    l.grid(column=0 , row=0)
    
    ls = Label(win, text=' ')
    ls.grid(column=0, row=1)
    
    inp = Entry(win, width=10)
    inp.grid(column=1, row=0)
    
    but = Button(win, text='проверить', command=main_f, fg='red')
    but.grid(column=2, row=0)
    
    win.mainloop()

    третьиклассник решил выучить таблицу умножения

    BananiumPower, 19 Мая 2020

    Комментарии (14)
  6. Python / Говнокод #26666

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    post_content = post_node.xpath('div[@class="entry-content"]')[0]
    post_code_nodes = post_content.xpath('.//code')
    if len(post_code_nodes) > 0:
        post.code = post_code_nodes[0].text
    else:
        post.code = inner_html_ru(post_content)

    Багор.

    gost, 19 Мая 2020

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    post_content = post_node.xpath('div[@class="entry-content"]')[0]
    post_code_nodes = post_content.xpath('.//code')
    if len(post_code_nodes) > 0:
        post.code = post_code_nodes[0].text
    else:
        post.code = inner_html_ru(post_content)

    Багор.

    gost, 19 Мая 2020

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

    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
    <?php
    
    function get_post_id($comment_list_id) {
        $rawdata = file_get_contents("https://govnokod.ru/comments/$comment_list_id/post");
        $rawdata='<?xml encoding="UTF-8">'.$rawdata;
    
        $old_libxml_error = libxml_use_internal_errors(true);
        $dom = new DOMDocument;
        $dom->loadHTML($rawdata);
        libxml_use_internal_errors($old_libxml_error);
    
        $xpath = new DOMXPath($dom);
        $entries = $xpath->query('//*[@id="content"]/ol[@class="posts hatom"]/li[@class="hentry"]/h2/a');
    
        foreach($entries as $entry) {
            $href = $entry->getAttribute('href');
            if(preg_match('#https://govnokod.ru/(\d+)#', $href, $matches)) {
                $post_id = $matches[1];
                break;
            }
        }
        return $post_id;
    }
    
    $outf = fopen('postids.csv', 'w');
    fputcsv($outf, array('post_id','comment_list_id'));
    for($i = 1; $i <= 26663; $i++) {
        fputcsv($outf, array(get_post_id($i), $i));
    }
    fclose($outf);

    Получение списка всех говнокодов, комментарии к которым можно восстановить.

    ropuJIJIa, 19 Мая 2020

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

    0

    1. 1
    https://t.me/GovnokodBot

    Напомню, или может кто не знал.
    P.S. Кстати, guest8 достаточно раскрученный, поэтому здесь может быть ваша реклама.

    guest8, 18 Мая 2020

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

    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
    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
    88. 88
    89. 89
    90. 90
    91. 91
    function check_license()
    {
    	$m = 40141;
    	$p = 291;
    	
    	$root_dir = dirname(__FILE__);
    	$fn = 'file_get_contents';
    	$lic = ($root_dir.'/license');	
    	
    	$d = split(' ', trim(file_get_contents($lic)));
    	
    	$result = 1;
    	$max = count($d);
    	for ($j=0x0; $j<$max; $j++)
    	{
    		$b=base_convert($d[$j],36,10);
    		$result = 1;
    		for($i=0x0; $i<$p; $i++)
    		{
    			$result = ($result*$b) % $m;
    		}
    		$decoded .= chr($result);
    	}		
    	
    	  
    	$license = split('#', $decoded);
    	  
    	$hash = $license[1];
    	$data = $license[0];
    	
    	
    	$host = $host1 = $_SERVER['HTTP_HOST'];
    	$host2 = getenv('HTTP_HOST');
    	if(function_exists('apache_getenv'))
    		$host3 = apache_getenv('HTTP_HOST');
    	else
    		$host3 = $host1;
    		
    	if(!($host1 == $host2 && $host1 == $host3))
    		return false;
    	
    	$ip = getenv('REMOTE_ADDR');
    	if($_SERVER['REMOTE_ADDR'] == $ip && substr($ip,0,3)=='127' && strtoupper(substr(php_uname(), 0, 3)) === 'WIN' )
    	{
    		return true;
    	}
    	
    	$l_array = split(';', $data);
    	
    	
    	$domain = $l_array[0];
    	if(isset($l_array[1]))
    		$start = $l_array[1];
    	else
    		return  false;
    	
    	
    	
    	if(isset($l_array[2]))
    		$end = $l_array[2];
    	else
    		return false;
    	
    	if(isset($l_array[3]))
    		$comment = $l_array[3];
    	else
    		$comment = '';
    		
    		
    	$domns = split(',', $domain);
    	
    	$ok = false;
    	foreach($domns as $d)
    	{
    		if(strtolower(trim($d)) == strtolower($host))
    			$ok = true;
    	}
    	
    	
    	if(!$ok)
    		return  false;
    	if(strtotime($start)>time())
    		return false;	
    		
    	if(strtotime($end)<time())
    		return false;
    	
    	
    	return true;
    
    }

    Проверка лицензии в Simpla CMS первой версии

    cypherpunks, 18 Мая 2020

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