1. Список говнокодов пользователя rotoeb

    Всего: 16

  2. Go / Говнокод #28943

    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
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    package main
    
    import (
    	"io"
    	"fmt"
    	"log"
    	"bytes"
    	"strings"
    	"net/http"
    	"net/http/httputil"
    	"net/url"
    )
    
    func UpdateResponse(r *http.Response) error {
    	for k, v := range r.Header {
    		newValue := strings.Replace(v[0], "umnico.com", "umnico.*****.ru", -1)
    		r.Header[k][0] = newValue
    	}
    	b, err := io.ReadAll(r.Body)
    	if(err == nil) {
    		bodyText := strings.Replace(string(b), "://umnico.com", "://umnico.*****.ru", -1);
    		if(strings.Contains(bodyText, "</head><body>")) {
    			injectedStyle := `<style>
    			.nav-menu.hidden, .widget__preview-container--tech-support {
    				display: none !important;
    			}
    			</style>`
    			bodyText = strings.Replace(bodyText, "</head><body>", injectedStyle + "</head><body>", -1);
    		}
    		if(strings.Contains(bodyText, "</body></html>")) {
    			injectedScript := `<script>
    			fetch('/api/user').then((response) => { 
    				return response.json().then((data) => {
    					//alert(data.user.id);
    					if(data.user.id != 12345) {
    						const style = document.createElement('style');
    						style.textContent = '.im__chat-buttons{display:none!important;}';
    						document.head.appendChild(style);
    					}
    					return true;
    				}).catch((err) => {
    					console.log(err);
    				}) 
    			});
    			var currentDialogId = 0;
    			function checkDialogControls() {
    				if(location.pathname.indexOf('app/deals/inbox/details/') > 0 || location.pathname.indexOf('app/deals/active/details/') > 0) {
    					if(location.pathname.indexOf('app/deals/active/details/') > 0) {
    						var dialogId = location.pathname.split('app/deals/active/details/')[1];
    					} else {
    						var dialogId = location.pathname.split('app/deals/inbox/details/')[1];
    					}
    					var chatIndicator = document.querySelector('.im-aside-section.im-aside-section__toolbox');
    					if(chatIndicator != null) {
    						var injectedControls = document.querySelector('.im-aside-section.injected-controls');
    						if(injectedControls == null) {
    							chatIndicator.insertAdjacentHTML('afterend', '<div class="im-aside-section injected-controls"><div><button type="button" class="button" style="width:100%;" onclick="window.parent.postMessage(\'openBookingModalByUmnicoId('+dialogId+')\', \'*\');">Оформить бронь</button></div><div style="margin-top:5px;"><button type="button" class="button button_attention" style="width:100%;" onclick="window.parent.postMessage(\'openLeadTaskModalByUmnicoId('+dialogId+')\', \'*\');">Задача</button></div></div>');
    						} else {
    							if(currentDialogId != dialogId) {
    								injectedControls.remove();
    							}
    						}
    						currentDialogId = parseInt(dialogId);
    					}
    				}
    			}
    
    			setInterval(checkDialogControls, 100);
    			</script>`
    			bodyText = strings.Replace(bodyText, "</body></html>", injectedScript + "</body></html>", -1);
    		}
    		
    		if(strings.Contains(bodyText, "window.location.hostname != \"localhost\"")) {
    			bodyText = strings.Replace(bodyText, "window.location.hostname != \"localhost\"", "window.location.hostname != \"localhost\" && window.location.hostname != \"umnico.*****.ru\"", -1);
    		}
    		
    		buf := bytes.NewBufferString(bodyText)
    		r.Body = io.NopCloser(buf)
    		r.Header["Content-Length"] = []string{fmt.Sprint(buf.Len())}
    	}
    	return nil
    }
    
    func main() {
    	target, err := url.Parse("https://umnico.com:443")
    	if err != nil {
    		log.Fatal(err)
    	}
    	proxy := httputil.NewSingleHostReverseProxy(target)
    	proxy.ModifyResponse = UpdateResponse
    	http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
    		req.Host = req.URL.Host
    		proxy.ServeHTTP(w, req)
    	})
    	err = http.ListenAndServe("127.0.0.1:8803", nil)
    	if err != nil {
    		panic(err)
    	}
    }

    Мой код для проксирования одного из SaaS-сервисов, с целью встраивания в интерфейс последнего кастомных кнопок. Взглянул спустя пару месяцев и ужаснулся.

    rotoeb, 17 Мая 2024

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

    −2

    1. 1
    А ведь были времена.

    rotoeb, 25 Ноября 2022

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

    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
    <style type="text/css" media="all">
    	html.cms a[href^="https://www.who.int"][href$="/en"] {background-color:#ffcc00;}
    	html.cms a[href^="https://www.who.int"][href$="/en/"] {background-color:#ffcc00;}
        html.cms a[href^="http://www.who.int"][href$="/en"] {background-color:#ffcc00;}
    	html.cms a[href^="http://www.who.int"][href$="/en/"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/en"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/en/"] {background-color:#ffcc00;}
    	html.cms a[href="/"] {background-color:inherit !important;}
    	html.cms a[href="/en"] {background-color:inherit !important;}
    	html.cms a[href="/en/"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/en"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/en/"] {background-color:inherit !important;}
    	html.cms a[href$="https://www.who.int/en"] {background-color:inherit !important;}
    	html.cms a[href$="https://www.who.int/en/"] {background-color:inherit !important;}
        html.cms a[href^="https://www.who.int"][href$="/ar"] {background-color:#ffcc00;}
    	html.cms a[href^="https://www.who.int"][href$="/ar/"] {background-color:#ffcc00;}
    	html.cms a[href^="http://www.who.int"][href$="/ar"] {background-color:#ffcc00;}
    	html.cms a[href^="http://www.who.int"][href$="/ar/"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/ar"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/ar/"] {background-color:#ffcc00;}
    	html.cms a[href="/ar"] {background-color:inherit !important;}
    	html.cms a[href="/ar/"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/ar"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/ar/"] {background-color:inherit !important;}
    	html.cms a[href^="https://www.who.int"][href$="/zh"] {background-color:#ffcc00;}
    	html.cms a[href^="https://www.who.int"][href$="/zh/"] {background-color:#ffcc00;}
    	html.cms a[href^="http://www.who.int"][href$="/zh"] {background-color:#ffcc00;}
    	html.cms a[href^="http://www.who.int"][href$="/zh/"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/zh"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/zh/"] {background-color:#ffcc00;}
    	html.cms a[href="/zh"] {background-color:inherit !important;}
    	html.cms a[href="/zh/"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/zh"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/zh/"] {background-color:inherit !important;}
    	html.cms a[href$="https://www.who.int/zh"] {background-color:inherit !important;}
    	html.cms a[href$="https://www.who.int/zh/"] {background-color:inherit !important;}
    	html.cms a[href^="https://www.who.int"][href$="/fr"] {background-color:#ffcc00;}
    	html.cms a[href^="https://www.who.int"][href$="/fr/"] {background-color:#ffcc00;}
        html.cms a[href^="http://www.who.int"][href$="/fr"] {background-color:#ffcc00;}
    	html.cms a[href^="http://www.who.int"][href$="/fr/"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/fr"] {background-color:#ffcc00;}
    	html.cms a[href^="/"][href$="/fr/"] {background-color:#ffcc00;}
    	html.cms a[href="/fr"] {background-color:inherit !important;}
    	html.cms a[href="/fr"] {background-color:inherit !important;}
    	html.cms a[href="/fr/"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/fr"] {background-color:inherit !important;}
    	html.cms a[href$="http://www.who.int/fr/"] {background-color:inherit !important;}
    	html.cms a[href$="https://www.who.int/fr"] {background-color:inherit !important;}
    	html.cms a[href$="https://www.who.int/fr/"] {background-color:inherit !important;}
    	html.cms a[href^="https://www.who.int"][href$="/ru"] {background-color:#ffcc00;}
    	html.cms a[href^="https://www.who.int"][href$="/ru/"] {background-color:#ffcc00;}
    </style>

    Сайт ВОЗ. Многое можно ожидать от frontend, но такое...

    rotoeb, 26 Ноября 2021

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

    +3

    1. 1
    Афганистан заебал.

    rotoeb, 26 Августа 2021

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    На любимом форуме Сёмы шаблоны никак не защищены от внешнего доступа. Сёме особенно должен понравиться последний файл:
    
    https://2ch.hk/makaba/templates/Search.template
    https://2ch.hk/makaba/templates/Archive.template
    https://2ch.hk/makaba/templates/Posting.template
    
    Судя по всему, используется шаблонизатор CTPP для Perl.

    rotoeb, 28 Мая 2021

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

    −1

    1. 1
    Чепига снова начинает остопяздывать.

    rotoeb, 19 Апреля 2021

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

    −3

    1. 1
    Обращение.

    Антонио, перепиши этот сайт на современный стек технологий. Очень рекомендую:
    - Vue или React
    - NodeJS или Go
    - MongoDB
    - побольше AJAX-а
    Очень неютно находиться на технически устаревшем сайте - какой-то колхозный PHP, голый HTML, JS и jQuery... Твоим сайтом хочется гордиться, а не блеваться от него.
    Новые фичи добавлять необязательно.

    rotoeb, 10 Ноября 2020

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

    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
    У студента из Камеруна на автостанции в Люберцах украли багаж на 1 млн рублей
    
    https://tass.ru/proisshestviya/9788371
    
    МОСКВА, 22 октября. /ТАСС/. Багаж студента из Камеруна, оставленный им без присмотра на автостанции
    в Люберцах, был похищен. Два чемодана украли двое ранее судимых мужчин, сообщила журналистам начальник
    пресс-службы ГУ МВД по Московской области Татьяна Петрова.
    
    "В Люберцах полицейские задержали мужчин, похитивших личные вещи у уроженца Республики Камерун. В
    дежурную часть поступило заявление от 25-летнего студента о том, что на автовокзале у него похитили два
    чемодана с принадлежащим ему имуществом. Общая сумма материального ущерба составила свыше 1 млн
    рублей", - сказала Петрова.
    
    Полиция установила, что двое мужчин на автостанции в городском округе Котельники увидели чемоданы без
    присмотра и украли их. Местный участковый нашел обоих по камерам наблюдения. Задержанными оказались
    39-летний уроженец Самарской области и 46-летний житель Подмосковья, оба ранее судимы. В ходе осмотра
    места происшествия в помещении автовокзала полицейским было обнаружено и изъято похищенное имущество
    и возвращено потерпевшему.
    
    Возбуждено уголовное дело по статье о краже, подозреваемые заключены под стражу.

    rotoeb, 24 Октября 2020

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

    −1

    1. 1
    2. 2
    В чём смысл этого сайта?
    Десять долбоёбов уже двенадцать лет перетирают одни и те же темы.

    rotoeb, 21 Октября 2020

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

    +1

    1. 1
    Микросервисы - это хорошо или плохо?

    rotoeb, 09 Октября 2020

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