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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    Астрологи объявили неделю постов с хабра. 
    
    Взоржал.  
    http://habrahabr.ru/company/edison/blog/271621/

    Vasiliy, 25 Ноября 2015

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

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    string str3 = Strings.Trim(ID);
     do
     {
         num2 = (short) Strings.InStr(str3, " ", CompareMethod.Binary);
         if (num2 > 0)
         {
                str3 = str3.Substring(0, num2 - 1) + Strings.Mid(str3, num2 + 1);
         }
    }
    while (num2 > 0);

    А зачем нам str3.Replace(" ", string.Empty) ?

    inickvel, 25 Ноября 2015

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

    +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
    $d = getdate();
    $formatMon = '';
    if ($d['mon'] < 10) {
    	$formatMon = '0';
    }
    
    $formatMday = '';
    if ($d['mday'] < 10) {
    	$formatMday = '0';
    }
    
    $formatHour = '';
    if ($d['hours'] < 10) {
    	$formatHour = '0';
    }
    
    $formatMinutes = '';
    if ($d['minutes'] < 10) {
    	$formatMinutes = '0';
    }
    
    $formatSeconds = '';
    if ($d['seconds'] < 10) {
    	$formatSeconds = '0';
    }
    
    $today = $formatMday . $d['mday'] . '.' . $formatMon . $d['mon'] . '.' . $d['year'] . ' ' . $formatHour . $d['hours'] . ':' . $formatMinutes . $d['minutes'] . ':' . $formatSeconds . $d['seconds'];

    Форматирование датывремени

    foreign, 25 Ноября 2015

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

    +4

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function checkRus($str)
    {
    	$result = true;
    	$eng = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
    	for ($i = 0; $i < strlen($str); $i++) {
    		if (in_array($str[$i], $eng)) {
    			$result = false;
    			break;
    		}
    	}
    	return $result;
    }

    Проверка на "русскость" строки

    foreign, 25 Ноября 2015

    Комментарии (29)
  5. C# / Говнокод #19081

    +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
    bool isLiveLine = false;
    bool isQALine = false;
    
    if (lineInfo.IndexOf("QL") != -1)
    {
     isLiveLine = true;
     isQALine = true;
    }
    else if (lineInfo.IndexOf("Q") != -1)
    {
     isLiveLine = false;
     isQALine = true;
    }
    else if (lineInfo.IndexOf("L") != -1)
    {
     isLiveLine = true;
     isQALine = false;
    }
    else
    {
     isLiveLine = false;
     isQALine = false;
    }

    pro687, 24 Ноября 2015

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

    −1

    1. 1
    2. 2
    "WCT" или "ебанутым нет покоя" - уже на главной Швабра!
    http://habrahabr.ru/post/271519/

    gost, 24 Ноября 2015

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    section.static > div[style="display:block; border: solid 1px #cfcfcf; padding : 10px"]{
        border: none !important;
        padding: 0 !important;
    }

    css-костыль!)

    Stefan_Hitskov, 24 Ноября 2015

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

    +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
    <ul class="top-level-menu">
                        <li style="width:14.185714285714%;" class="with-img" id="m_2641231722"> <span class="top-level-label"><a href="/catalog/plitnye_materialy_1/" title="Плитные материалы">Плитные материалы</a></span>
                </li>
                        <li style="width:14.185714285714%;" class="with-img" id="m_1862201143"> <span class="top-level-label"><a href="/catalog/mebelnaya_furnitura_1/" title="Мебельная фурнитура">Мебельная фурнитура</a></span>
                </li>
                        <li style="width:14.185714285714%;" class="with-img" id="m_2776938111"> <span class="top-level-label"><a href="/catalog/kromka_i_plastiki_1/" title="Кромка и пластики">Кромка и пластики</a></span>
                </li>
                        <li style="width:14.185714285714%;" class="with-img" id="m_2757459272"> <span class="top-level-label"><a href="/catalog/stoleshnitsy_stenpaneli_1/" title="Столешницы, стенпанели">Столешницы, стенпанели</a></span>
                </li>
                        <li style="width:14.185714285714%;" class="with-img" id="m_3136652235"> <span class="top-level-label"><a href="/catalog/razdvizhnye_sistemy_1/" title="Раздвижные системы">Раздвижные системы</a></span>
                </li>
                        <li style="width:14.185714285714%;" class="with-img" id="m_3746925619"> <span class="top-level-label"><a href="/catalog/fasadnoe_napolnenie_1/" title="Фасадное наполнение">Фасадное наполнение</a></span>
                </li>
                        <li style="width:14.185714285714%;" class="with-img" id="m_133346203"> <span class="top-level-label"><a href="/catalog/uslugi_1/" title="Услуги">Услуги</a></span>
                </li>
        </ul>

    Stefan_Hitskov, 24 Ноября 2015

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

    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
    <section class="static">  <!--Первый-->
                    <style>
                .simple-rotator-container-2 a.rot-partner-100127            {
                    background-image: url(/upload/iblock/129/petli.jpg);
                    background-position: center top;
                }                             
                .simple-rotator-container-2 a.rot-partner-100127:hover
                {
                    background-image: url(/upload/iblock/129/petli.jpg);
                    background-position: center bottom;
                }                             
                .simple-rotator-container-2 a.rot-partner-100136            {
                    background-image: url(/upload/iblock/755/zamki.jpg);
                    background-position: center top;
                }                             
                .simple-rotator-container-2 a.rot-partner-100136:hover
                {
                    background-image: url(/upload/iblock/755/zamki.jpg);
                    background-position: center bottom;
                }                             
                .simple-rotator-container-2 a.rot-partner-100137            {
                    background-image: url(/upload/iblock/dff/napravlyalki.jpg);
                    background-position: center top;
                }                             
                .simple-rotator-container-2 a.rot-partner-100137:hover
                {
                    background-image: url(/upload/iblock/dff/napravlyalki.jpg);
                    background-position: center bottom;
                }                             
                .simple-rotator-container-2 a.rot-partner-100138            {
                    background-image: url(/upload/iblock/8a2/metiznaya.jpg);
                    background-position: center top;
                }                             
                .simple-rotator-container-2 a.rot-partner-100138:hover
                {
                    background-image: url(/upload/iblock/8a2/metiznaya.jpg);
                    background-position: center bottom;
                }                             
                .simple-rotator-container-2 a.rot-partner-100139            {
                    background-image: url(/upload/iblock/6e9/kukhonne-_2_.jpg);
                    background-position: center top;
                }                             
                .simple-rotator-container-2 a.rot-partner-100139:hover
                {
                    background-image: url(/upload/iblock/6e9/kukhonne-_2_.jpg);
                    background-position: center bottom;
                }                             
                .simple-rotator-container-2 a.rot-partner-100140            {
                    background-image: url(/upload/iblock/cb2/p_dyom.jpg);
                    background-position: center top;
                }                             
                .simple-rotator-container-2 a.rot-partner-100140:hover
                {
                    background-image: url(/upload/iblock/cb2/p_dyom.jpg);
                    background-position: center bottom;
                }                             
                .simple-rotator-container-2 a.rot-partner-100141            {
                    background-image: url(/upload/iblock/e5a/catalogue_302kh302.jpg);
                    background-position: center top;
                }                             
                .simple-rotator-container-2 a.rot-partner-100141:hover
                {
                    background-image: url(/upload/iblock/e5a/catalogue_302kh302.jpg);
                    background-position: center bottom;
                }                             
    </style>    
    <section class="static"> <!-- И после всего этого одного следующий секшин статик, прям внутри!-->
    
    <!--Дальше отжигают контентщики-->
        <p style="text-align: justify;"><img style="width: 1280px; height: 302px; " src="/upload/iblock/b72/muller.jpg" alt="Muller"></p>
        
        <p style="text-align: center;"></p>
    <div class="cube">
                <div class="round_holder">
                <a href="/catalog/petli_i_aksessuary_1/?arrFilter_49_4012090960=Y&set_filter=">
                   <img style="width: 302px; height: 302px; float: left;" src="/upload/iblock/129/petli.jpg" alt="Muller">
        	       <p><ong><span style="color:#000;">Петли и аксессуары</span></ong></p>
               </a>    
        	</div>     
                <div class="round_holder">
                <a href="/catalog/zamki_magnity_2/?arrFilter_49_4012090960=Y&set_filter=">
                   <img style="width: 302px; height: 302px; float: left;" src="/upload/iblock/755/zamki.jpg" alt="Muller">
        	       <p><ong><span style="color:#000;">Замки</span></ong></p>
               </a>    
        	</div>

    ...

    Stefan_Hitskov, 24 Ноября 2015

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

    +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
    function getQuarter(month) {
                            if (0 <= month && month <= 2) return "Q1 ";
                            if (3 <= month && month <= 5) return "Q2 ";
                            if (6 <= month && month <= 8) return "Q3 ";
                            return "Q4 ";
                        };
    
                        function getDate(lastActionDate) {
                            var dateString = lastActionDate.split(/\-|\s/);
                            var date = new Date(dateString.slice(0, 2));
                            var month = date.getMonth();
                            var year = date.getFullYear();
                            var quarter = getQuarter(month);
                            return "<span>Last Action Plan: <br> " + quarter + year + "</span>";
                        }

    на проекте активно используется momentjs

    zxxc, 24 Ноября 2015

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