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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    Когда написал залупу на крестах
    https://pbs.twimg.com/media/EQNGt9QU4AABnd1?format=png&name=small
    
    Именно поэтому я за Electron.js

    phpBidlokoder2, 08 Февраля 2020

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

    +5

    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
    function fix_hacker_strings($str){
            $s=$str;
            $s=str_replace('/*', 'xx', $s);
            $s=str_replace('*/', 'xx', $s);
            $s=str_replace('../', 'xxx', $s);
            $s=str_replace('..\\', 'xxx', $s);
            $s=str_ireplace('file:', 'xxxxx', $s);
            $s=str_ireplace(':$', 'xx', $s);
            $s=str_ireplace('http:', 'xxxx', $s);
            $s=str_ireplace('https:', 'xxxxx', $s);
            $s=str_ireplace('script', 'xxxxxx', $s);
            $s=str_ireplace('delete', 'xxxxxx', $s);
            $s=str_ireplace('drop', 'xxxx', $s);
            $s=str_ireplace('select', 'xxxxxx', $s);
            $s=str_ireplace('update', 'xxxxxx', $s);
            $s=str_ireplace('replace', 'xxxxxxx', $s);
            $s=str_ireplace('/etc/', '/xxx/', $s);
            $s=str_ireplace('/var/', '/xxx/', $s);
            $s=str_ireplace('/root/', '/xxxx/', $s);
            $s=str_ireplace('/bin/', '/xxx/', $s);
            $s=str_ireplace('/usr/', '/xxx/', $s);
            $s=str_ireplace('/sys/', '/xxx/', $s);
            $s=str_ireplace('/sbin/', '/xxxx/', $s);        
            $s=str_ireplace('/proc/', '/xxxx/', $s);
            $s=str_ireplace('/boot/', '/xxxx/', $s);
            $s=str_ireplace('mysql', 'xxxxx', $s); 
            return $s;
    }

    обработка user input

    dim1r, 08 Февраля 2020

    Комментарии (78)
  3. 1C / Говнокод #26424

    −3

    1. 1
    Приведите реальный пример программы на 1С

    Вот прямо типичный пример задачи, где я должен взять именно 1С.

    bagrinho, 08 Февраля 2020

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

    0

    1. 1
    IT Оффтоп #31

    #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: https://govnokod.ru/24063 (потёр пидор сракер) https://govnokod.xyz/_24063
    #7: https://govnokod.ru/24538 https://govnokod.xyz/_24538
    #8: https://govnokod.ru/24815 (потёр пидор сракер) https://govnokod.xyz/_24815
    #9: https://govnokod.ru/24867 https://govnokod.xyz/_24867
    #10: https://govnokod.ru/25328 https://govnokod.xyz/_25328
    #11: https://govnokod.xyz/_25436 https://govnokod.ru/25436 (потёр пидор сракер)
    #12: https://govnokod.xyz/_25471
    #13: https://govnokod.xyz/_25590 (потёр пидор сракер)
    #14: https://govnokod.xyz/_25684
    #15: https://govnokod.xyz/_25694
    #16: https://govnokod.xyz/_25725
    #17: https://govnokod.xyz/_25731
    #18: https://govnokod.xyz/_25762
    #19: https://govnokod.xyz/_25767
    #20: https://govnokod.xyz/_25776
    #21: https://govnokod.xyz/_25798
    #22: https://govnokod.xyz/_25811
    #23: https://govnokod.xyz/_25863
    #24: https://govnokod.xyz/_25941
    #25: https://govnokod.xyz/_26026
    #26: https://govnokod.xyz/_26050
    #27: https://govnokod.xyz/_26340
    #28: https://govnokod.xyz/_26372
    #29: https://govnokod.xyz/_26385
    #30: https://govnokod.xyz/_26413

    syoma, 08 Февраля 2020

    Комментарии (850)
  5. JavaScript / Говнокод #26422

    +3

    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
    onst addAdjacencies = (
      nodes,
    ) => (
      nodes
      .map(({
        colorId,
        id,
        x,
        y,
      }) => ({
        color: colors[colorId],
        eastId: (
          getNodeAtLocation({
            nodes,
            x: x + 1,
            y,
          })
        ),
        id,
        northId: (
          getNodeAtLocation({
            nodes,
            x,
            y: y - 1,
          })
        ),
        southId: (
          getNodeAtLocation({
            nodes,
            x,
            y: y + 1,
          })
        ),
        westId: (
          getNodeAtLocation({
            nodes,
            x: x - 1,
            y,
          })
        ),
      }))
      .map(({
        color,
        id,
        eastId,
        northId,
        southId,
        westId,
      }) => ({
        adjacentIds: (
          [
            eastId,
            northId,
            southId,
            westId,
          ]
          .filter((
            adjacentId,
          ) => (
            adjacentId !== undefined
          ))
        ),
        color,
        id,
      }))
    )

    https://medium.com/free-code-camp/bet-you-cant-solve-this-google-interview-question-4a6e5a4dc8ee

    джаваскриптер натужно пытается решить простейшую задачу "гугл уровня" с обходом, для увеличения кринжа прилагается поехавший кодстайл и решение на RxJS

    Fike, 08 Февраля 2020

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

    0

    1. 1
    Этот ебаный мир катицца в бездну.

    Блять, бог, нажми уже F9!

    AnalBoy, 07 Февраля 2020

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    PHP
    print 3 --0-- 5 == 8; // Parse error
    Java Script
    console.log(3 --0-- 5 == 8); // Uncaught SyntaxError: Invalid left-hand side expression in postfix operation
    Python
    print(3 --0-- 5 == 8) // true

    Именно поэтому я за "PHP" и "Java Script"

    phpBidlokoder2, 07 Февраля 2020

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

    0

    1. 1
    2. 2
    Гавно, вот нахуя ты удалило мой пост про бабушку и ишака?
    Высеры гостя в упор не видишь, а мои трёшь... Нехорошо.

    Провёл тебе залупой по губам, за такое деяние.

    AnalBoy, 07 Февраля 2020

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

    +4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    if ($input->search_text!=""){
    		if ($input->search_text=="хуйня" or $input->search_text=="ХУЙНЯ" or $input->search_text=="Хуйня")
    			$this->result.="У нас серьезная компания и мы всякой хуйни на сайте не держим.";
    		else{
    		if (strlen($input->search_text)<2)
    			$this->result.="Строка поискового запроса должна состоять минимум из 2 символов.<br>Пожалуйста, измените Ваш запрос и повторите поиск.";
    		else{
    			$result.="Вы искали: <u><b>".$input->search_text."</b></u><br><br>";

    Вот такие вот пасхалки у серьёзных компаний. И такой код.

    vistefan, 07 Февраля 2020

    Комментарии (118)
  10. SQL / Говнокод #26417

    +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
    SET @from = 11836;
    SET @to = 11840;
    
    INSERT INTO `sprinter_catalog_tree` (
        `sprinter_catalog_tree`.`level`,
        `sprinter_catalog_tree`.`position`,
        `sprinter_catalog_tree`.`parent_id`,
        `sprinter_catalog_tree`.`catalog`,
        `sprinter_catalog_tree`.`info_id`,
    --  ...
    )
    SELECT
        `sprinter_catalog_tree`.`level`,
        `sprinter_catalog_tree`.`position`,
        @to,
        `sprinter_catalog_tree`.`catalog`,
        `sprinter_catalog_tree`.`info_id`,
        `sprinter_catalog_tree`.`format_id`,
        `sprinter_catalog_tree`.`linked_id`,
        `sprinter_catalog_tree`.`linked_shablon_id`,
    --  ...
    FROM `sprinter_catalog_tree` where parent_id = @from order by id;
    
    INSERT INTO `sprinter_catalog_tree` (
        `sprinter_catalog_tree`.`level`,
        `sprinter_catalog_tree`.`position`,
        `sprinter_catalog_tree`.`parent_id`,
        `sprinter_catalog_tree`.`catalog`,
        `sprinter_catalog_tree`.`info_id`,
    --  ...
    )
    SELECT
        a.`level`,
        a.`position`,
        (SELECT id from sprinter_catalog_tree as b where b.parent_id = @to and b.name like (SELECT name from sprinter_catalog_tree where id = a.parent_id)),
        a.`catalog`,
        a.`info_id`,
        a.`format_id`,
        a.`linked_id`,
        a.`linked_shablon_id`,
    --  ...
    FROM `sprinter_catalog_tree` as a where parent_id in (SELECT id FROM sprinter_catalog_tree where parent_id = @from) order by id;
    
    INSERT INTO `sprinter_catalog_info`
    (`name`,
    `eng_name`,
    `text`,
    --  ..
    )
    SELECT
        `sprinter_catalog_info`.`name`,
        `sprinter_catalog_info`.`eng_name`,
        `sprinter_catalog_info`.`text`,
        `sprinter_catalog_info`.`short_text`,
    --  ...
    FROM `sprinter_catalog_info` where id in (SELECT info_id from `sprinter_catalog_tree` where parent_id = @from or parent_id in (SELECT id from `sprinter_catalog_tree` where parent_id = @from));
    
    CREATE temporary table if not exists ids
    SELECT id from `sprinter_catalog_tree` where parent_id = @to or parent_id in (SELECT id from `sprinter_catalog_tree` where parent_id = @to);
    
    UPDATE sprinter_catalog_tree as a SET info_id = (SELECT id from sprinter_catalog_info as b where a.name like b.name order by id desc limit 1) where a.id in (SELECT id from ids);
    
    DROP table ids;

    Высрал вот такое говно в качестве write-n-throw скрипта.

    Дано: есть элементы дерева, хранящиеся в таблице sprinter_catalog_tree, связаны друг с другом через parent_id. Каждому из них соответствует указанный в info_id элемент таблицы sprinter_catalog_info.

    Задача: скопировать все вложенные в раздел @from каталога элементы и его подразделы (вложенность не более 1 уровня) в раздел @to, так чтобы у них были новые id, и также скопировать соответствующие им sprinter_catalog_info. Скопированные sprinter_catalog_tree должны указывать на корректные sprinter_catalog_info, id которых заранее не известны.

    Вот такое говно получилось, расскажите как надо было?

    vistefan, 05 Февраля 2020

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