1. JavaScript / Говнокод #17135

    +159

    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
    function get() {
      var a, g, d = app.vk.friend.OSS;
      1 > db.contacts.length && VK.api( "friends.get", {fields: "photo_rec,contacts"}, function ( j )
      {
        if ( j.response )
        {
          try
          {
            app.vk.friend.inited = !1;
            g = j.response.length;
            var e = [], b, f = null, m = null;
            for ( a = 0; a < g; a++ )
            {
              b = j.response[a].mobile_phone || "";
              var m = f = null, c = b.match( /\d/g );
              if ( !c || !(7 == c.length && "9" == c[0] || 10 == c.length || 11 == c.length) )
              {
                b = null;
              }
              b && 11 == c.length && (b = "bbbccccccc".replace( "a", c[0] ).replace( "b", c[1] ).replace( "b", c[2] ).replace( "b", c[3] ).replace( "c", c[4] ).replace( "c", c[5] ).replace( "c", c[6] ).replace( "c", c[7] ).replace( "c", c[8] ).replace( "c", c[9] ).replace( "c", c[10] ));
              b && 10 == c.length && (b = "bbbccccccc".replace( "b", c[0] ).replace( "b", c[1] ).replace( "b", c[2] ).replace( "c", c[3] ).replace( "c", c[4] ).replace( "c", c[5] ).replace( "c", c[6] ).replace( "c", c[7] ).replace( "c", c[8] ).replace( "c", c[9] ));
              b && (7 == c.length && "9" == c[0]) && (b = null);
              b && 10 == c.length && (f = c[0] + c[1] + c[2]);
              b && 11 == c.length && (f = c[1] + c[2] + c[3]);
              b && (e[e.length] = b);
              m = d[null != f ? 2 : 0];
              db.contacts[db.contacts.length] = {uid: j.response[a].uid, first_name: j.response[a].first_name, last_name: j.response[a].last_name, name: j.response[a].first_name + " " + j.response[a].last_name, photo: j.response[a].photo || j.response[a].photo_rec || j.response[a].photo_big, phoneOrig: j.response[a].mobile_phone || "", phone: b, mask: f, oper: m, oper_i: m == d[1] ? 2 : m != d[0] ? 1 : 0, app_status: 0}
            }
            var p, i = app.scnet.form.checkNumbers( e );
            g = i.SUBSCRIBER && i.SUBSCRIBER.length ? i.SUBSCRIBER.length : i.SUBSCRIBER ? 1 : 0;
            1 == g && (i.SUBSCRIBER = [i.SUBSCRIBER]);
            for ( a = 0; a < g; a++, p = null )
            {
              1 == i.SUBSCRIBER[a].SELF && (p = db.contacts.find( "phone", i.SUBSCRIBER[a].MSISDN )), p && (db.contacts.find( "phone", i.SUBSCRIBER[a].MSISDN ).oper = d[1], db.contacts.find( "phone", i.SUBSCRIBER[a].MSISDN ).oper_i = 2);
            }
            document.all ? setTimeout( app.vk.friend.getAppFri, 1E3 ) : document.all || app.vk.friend.getAppFri()
          }
          catch ( t )
          {}
        }
      } )
    }

    Здесь прекрасно всё, и как картины Босха можно рассматривать эту лапшу бесконечно.

    bodeaux, 19 Ноября 2014

    Комментарии (2)
  2. JavaScript / Говнокод #17129

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    setInterval(
       setTimeout(){
          function(){
            updater();
          },
         10
       }
    ,2000);

    Просто увидел в коде

    kit, 18 Ноября 2014

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

    +156

    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
    // ==UserScript==
    // @name AutoConfirm
    // @namespace test
    // @include http://[CENSORED]/reviewboard/*
    // @version 1
    // @grant none
    // ==/UserScript==
    
    setTimeout(
    function(){
    window.confirm = function(msg){return true;};
    document.getElementById("shipit-link").click();
    },
    2000
    );

    Ускорение code review

    kit, 18 Ноября 2014

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

    +158

    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
    var result = {success: true};
    	
    	var arr = sumParam(info, null, null, /<td[^>]+class="rate"[^>]*>([\s\S]*?)<\/td>/ig, replaceTagsAndSpaces, html_entity_decode);
    	//Доллар/Гривна
    	AnyBalance.trace(arr[0]);
    	AnyBalance.trace(arr[1]);
    	AnyBalance.trace(arr[2]);
    	AnyBalance.trace(arr[3]);
    	//Евро/Гривна
    	AnyBalance.trace(arr[4]);
    	AnyBalance.trace(arr[5]);
    	AnyBalance.trace(arr[6]);
    	AnyBalance.trace(arr[7]);
    	//Рубль/Гривна
    	AnyBalance.trace(arr[8]);
    	AnyBalance.trace(arr[9]);
    	AnyBalance.trace(arr[10]);
    	AnyBalance.trace(arr[11]);
    	
    	result.USDpok = parseFloat(arr[2].replace(',', '.'));
    	result.USDpro = parseFloat(arr[3].replace(',', '.'));
    	result.EURpok = parseFloat(arr[6].replace(',', '.'));
    	result.EURpro = parseFloat(arr[7].replace(',', '.'));
    	result.RUBpok = parseFloat(arr[10].replace(',', '.'));
    	result.RUBpro = parseFloat(arr[11].replace(',', '.'));
    	AnyBalance.setResult({
    		success: true,
    		USDpok: result.USDpok,
    		USDpro: result.USDpro,
    		EURpok: result.EURpok,
    		EURpro: result.EURpro,
    		RUBpok: result.RUBpok,
    		RUBpro: result.RUBpro
    	});

    Провайдер для одного балансового приложения, я просто не сдержался, пришлось даже зарегистрироваться)

    Starksoft, 17 Ноября 2014

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

    +166

    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
    function chekemailandpas(e) {
      var email1val = $('#email1').val();
      var pas1val = $('#password1').val();
      var name1val = $('#name1').val();
      var famil2val = $('#famil2').val();
      name1val = del_spaces(name1val);
      famil2val = del_spaces(famil2val);
      email1val = del_spaces(email1val);
      pas1val = del_spaces(pas1val);
      email1 = email1val.length;
      pas1 = pas1val.length;
      if(!e) {
       e = event || window.event; 
      }
      if(e == '[object MouseEvent]' || e.keyCode == 13 && email1val !== '' &&  pas1val !== '') {
        if(email1 < 5) {
          setTimeout(function() {
            $('#email1').css('background', 'rgba(240,128,128, 0.1)');
            setTimeout(function() {
              $('#email1').css('background', 'rgba(240,128,128,0.2)');
              setTimeout(function() {
                $('#email1').css('background', 'rgba(240,128,128,0.3)');
                setTimeout(function() {
                  $('#email1').css('background', 'rgba(240,128,128,0.4)');
                  setTimeout(function() {
                    $('#email1').css('background', 'rgba(240,128,128,0.5)');
                  }, 50);
                }, 50);
              }, 50);
            }, 50);
          }, 500);
          if($('#email1').css('background', 'rgba(240,128,128,0.5)')) {
            setTimeout(function() {
              $('#email1').css('background', 'rgba(240,128,128, 0.4)');
              setTimeout(function() {
                $('#email1').css('background', 'rgba(240,128,128,0.3)');
                setTimeout(function() {
                  $('#email1').css('background', 'rgba(240,128,128,0.2)');
                  setTimeout(function() {
                    $('#email1').css('background', 'rgba(240,128,128,0.1)');
                    setTimeout(function() {
                      $('#email1').css('background', 'rgba(240,128,128,0.0)');
                    }, 50);
                  }, 50);
                }, 50);
              }, 50);
            }, 500);
          }
        }
        if(pas1 < 2) {
          setTimeout(function() {
            $('#password1').css('background', 'rgba(240,128,128, 0.1)');
            setTimeout(function() {
              $('#password1').css('background', 'rgba(240,128,128,0.2)');
              setTimeout(function() {
                $('#password1').css('background', 'rgba(240,128,128,0.3)');
                setTimeout(function() {
                  $('#password1').css('background', 'rgba(240,128,128,0.4)');
                  setTimeout(function() {
                    $('#password1').css('background', 'rgba(240,128,128,0.5)');
                  }, 50);
                }, 50);
              }, 50);
            }, 50);
          }, 500);
          if($('#password1').css('background', 'rgba(240,128,128,0.5)')) {
            setTimeout(function() {
              $('#password1').css('background', 'rgba(240,128,128, 0.4)');
              setTimeout(function() {
                $('#password1').css('background', 'rgba(240,128,128,0.3)');
                setTimeout(function() {
                  $('#password1').css('background', 'rgba(240,128,128,0.2)');
                  setTimeout(function() {
                    $('#password1').css('background', 'rgba(240,128,128,0.1)');
                    setTimeout(function() {
                      $('#password1').css('background', 'rgba(240,128,128,0.0)');
                    }, 50);
                  }, 50);
                }, 50);
              }, 50);
            }, 500);
          }
        }
        if(email1 > 4 && pas1 > 1) {
          var pagename = 'email='+email1val+'&password='+pas1val+'&name='+name1val+'&famil='+famil2val;
          sendRequest(pagename);
    
        }
      }
    }

    dannikonov, 16 Ноября 2014

    Комментарии (34)
  6. JavaScript / Говнокод #17111

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    var list = [ ];
    
    // hidden elements
    list[ NaN ] = 'this-element-always-is-last'; // max index
    list[ Number.MAX_VALUE ] = 'this-is-smallest';
    list[ Infinity ] = 'this-just-infinity';
    
    // list.length == 0; // true

    Делать нечего в селе, мы сидим навеселе. Всех с пятницей!

    bot, 14 Ноября 2014

    Комментарии (28)
  7. JavaScript / Говнокод #17102

    +159

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    jQuery(document).
    filter(function() { return window.top.document === this; }).
    ready(function() {
    jQuery(window.top.document).
    find('body').
    append('<div style="position:absolute;position:fixed;bottom:20px;left:10px;z-index:9999;padding:2px;padding-top:6px;border:2px #808080 solid;border-radius:9px;box-shadow:0 0 10px rgba(128,128,128,0.8);">'
    +'<img border="0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAIt0lEQVRo3sVabYxUVxl+zr3n3jvsLju7LB8VpEFNaIo/SMENiSRKozbVhJQfTdSKv5T6RUEg3QVF7bbUbk0oH/aH1qZiVz7/NWK1JtIFGxENgVihVDC1CAMs2dnp0pm5H+ec1x9zzuzZy+7ssDvbns3Jzt47973vc96v5z1nGaY4iIjpjw4ABoADcAF41jUCIAEIPSUApa+DMUaTfT9rkPJMK8214oEFwAwFIAYQAUg0kCmD4A1U3gPgA5ihAbgnT/6t+caNG/6qVavybW1Z6O+4AMr62SoIImKTAcEaqHyglW8C4B0+cmRB/+vH15bL5TnZbPbve/bs6tMAYwAlPeOpWsJpoPJNAJoBZF599Q8fOXasf/1QobCiWCotuXnz5rLu7m2rkyRhFsgZ+lluxYotv/EA6lA+OHHiL21Hjx5dN/xeYUkcRR8XSXJXFEX35HK5zt7en63Uz6dBuDaIaQFQj/KnTp1q3b//QHc+n18eRtFCRconUEYqeXepXFp+8eLF+5955tkVWk6TnhntWlUQd2IFpwE+3wzAP3P2bNNLv963pVAYujcMo7uVVBlSBD1niER8rFh8f8WFCxe+tHPnc51aVrMBn7ZEvSDYFJVvARCcP/9WsHv3nieGhoY+GcfxAiLyxhGXuK57rbW19c1ly+47tHHjhn/qlFoCUAQQ6r/rrhPOJPK8SZXNQojg8uXL7q5du3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GTtZd61lbQbPy6dYvfUhoy2IpWab4xZY845K3nViyOk8nHQuMg9Gn6pTyc5nKHmRtHtuLYp9EsjFYo/n3HFXryPX/TagbIFNLd74AAAAASUVORK5CYII=" /></div></div>'
    ....

    вот так делает img

    ryselis, 13 Ноября 2014

    Комментарии (26)
  8. JavaScript / Говнокод #17097

    +160

    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
    $scope.close_menu = function(resize){
            if(window.innerWidth<=1023) var width=280;
            else var width=390;
            var duration=(resize)? 0:300;
            $('.menu').removeClass('active').animate({right:-width+'px'},duration);
            $('.wrapper').animate({right:'0px'},duration);
            $('body').css({'overflow':'auto'});
            $('.menu_btn').animate({marginRight:'0px'},duration,function(){});
            $('.videocontainer').animate({right:'0px'},duration);
            $('.blog_share.active > a,.blog_share.active > ul').animate({right:'0px'},duration);
            $('.backgorund_transparent').hide();
    
            if(typeof isMoving != 'undefined') isMoving=false;
        }

    Просто AngularJs...

    keitoaino, 12 Ноября 2014

    Комментарии (26)
  9. JavaScript / Говнокод #17080

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    for (var i=0; i<snake.length-25; ++i) {
        if (checkTouch(snake[i], newHead)) {
            state = "gameover";
            return;
        }
    }

    В приступе ностальгии портанул свой старый говнокодец с турбопасцаля на жс.

    Погамать можно тут: http://bormand.tk/snake/

    bormand, 07 Ноября 2014

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

    +155

    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
    $(function() {
    			$('#diametr').on('change', function() {
    				window.location = '/catalog/<?=$arResult['SECTION']['CODE']?>/'+this.value+'/';
    			});
    			
    			$('#type_s').on('change', function() {
    				$('#size_s').find('option:enabled').prop("disabled", true);
    				$('#size_s').find('option[data-prop-material='+$(this).find('option:selected').data('propMaterial')+']').prop("disabled", false).first().prop("selected", true);
    				$('#size_s').trigger('change')
    			});
    			
    			$('#type_p').on('change', function() {
    				$('#size_p').find('option:enabled').prop("disabled", true);
    				$('#size_p').find('option[data-prop-type='+$(this).find('option:selected').data('propType')+']').prop("disabled", false).first().prop("selected", true);
    				$('#size_p').trigger('change')
    			});
    			
    			
    			$(document)
    				.on('change', '#size_s, #size_p', function() {
    					
    					$('#selected_prop').val('csone_19_'+$(this).find('option:selected').data('propId'));
    				})
    				.on('click', '.but_sita', function() {
    					console.log($(this).parent().find('select').first());
    					$(this).parent().find('select').first().trigger('change');
    				});
    			$('.but_sita').last().trigger('click');
    			
    			$('#additional_spoiler').on('click', function(e) {
    				e.preventDefault();
    				$('#additional').fadeIn();
    			});
    		});

    UncaughtException, 29 Октября 2014

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