1. PHP / Говнокод #24599

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    https://madnight.github.io/githut/#/pull_requests/2018/2
    
    Python, Ruby, C++, Java и Go популярнее чем PHP.
    
    PHP не нужен

    roskomgovno, 07 Августа 2018

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    https://news.mail.ru/video/574647/
    
    В Камеруне произошел самый массовый побег из тюрьмы за последние годы.
    Около 160-ти заключенных сбежали из тюрьмы на северо-западе. Они прорвались
    через главные ворота, после чего подожгли здание. По предварительным данным,
    преступникам помогала вооруженная группа. Сейчас беглецов ищут.

    Мне страшно...

    20_BLACK_CENTIMETERS, 07 Августа 2018

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

    0

    1. 1
    In 2011, a woman in Georgia pierced a fiber backbone line with a shovel and left the neighboring country of Armenia without Internet access for 12 hours (с) Wikipedia

    Давайте что-нить ругать

    roskomgovno, 07 Августа 2018

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    document.querySelector('.button').onmousemove = function (e) {
        var x = e.pageX - e.target.offsetLeft;
        var y = e.pageY - e.target.offsetTop;
        e.target.style.setProperty('--x', x + 'px');
        e.target.style.setProperty('--y', y + 'px');
      };

    nvrngrek1, 07 Августа 2018

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

    −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
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    <?php
    namespace app\forms;
    
    use std, gui, framework, app;
    use action\Element; 
    
    
    class Progress extends AbstractForm
    {
    
        /**
         * @event progressBar.step 
         */
        function doProgressBarStep(UXEvent $e = null)
        {
            
            
            // Generated
            $e = $event ?: $e; // legacy code from 16 rc-2
            
            Element::appendValue($this->progressBar, 1.0);
        }
    
        /**
         * @event construct 
         */
        function doConstruct(UXEvent $e = null)
        {    
            
        }
    
    }

    Почему же ползунок не лезет? Взято из девелнекста (develnext).

    shite, 07 Августа 2018

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

    +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
    let suffix = '';
    
    if (search) {
      if (filters.length) {
        suffix = ' found:';
      } else {
        suffix = ' found';
      }
    } else {
      if (filters.length) {
        suffix = ' found:';
      }
    }

    Когда не уверен, нужно двоеточие или нет.

    b4lk0n, 07 Августа 2018

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

    0

    1. 1
    2. 2
    3. 3
    Какие есть пасхальные яйца в "PHP"?
    Вроде "import this" или "from __future__ import braces" в "Python",
    или "long long long is too long for GCC" в "GCC".

    LinuxGovno, 06 Августа 2018

    Комментарии (34)
  8. Swift / Говнокод #24592

    +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
    // NextViewController.swift
    
    override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) {
        NSUserDefaults.standardUserDefaults().setInteger(indexPath.row, forKey: "Selected offense")
    		
        let offense: NSDictionary = self.offenses.objectAtIndex(indexPath.row) as NSDictionary
        let id: Int = offense.objectForKey("id") as Int
        let title: String = offense.objectForKey("title") as String
        NSUserDefaults.standardUserDefaults().setInteger(id, forKey: "Selected offense id")
        NSUserDefaults.standardUserDefaults().setObject(title, forKey: "Selected offense title")
    }
    
    // PreviousViewController.swift
    
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        hideKeyboard()
        tableView.reloadData()
    }
    	
    func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
        let kCellIndetifier: String = "NewOffenseCell"
        var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIndetifier, forIndexPath: indexPath) as UITableViewCell
    		
        if cell == nil {
            cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: kCellIndetifier)
        }
    		
        cell.text = NSUserDefaults.standardUserDefaults().stringForKey("Selected offense title")
        cell.font = UIFont.systemFontOfSize(20)
        return cell
    }

    Реализуем колбэки *лицорука*

    def, 06 Августа 2018

    Комментарии (95)
  9. Swift / Говнокод #24591

    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
    func createCrossForRemovingImage() {
    		var firstCrossView: UIImageView = UIImageView(frame: CGRectMake(90, -10, 30, 30))
    		firstCrossView.layer.cornerRadius = 15
    		firstCrossView.image = UIImage(named: "Cross")
    		firstCrossView.tag = 200
    		firstCrossView.userInteractionEnabled = true
    		firstCrossView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "removeImage:"))
    		firstCrossView.hidden = true
    		
    		var secondCrossView: UIImageView = UIImageView(frame: CGRectMake(90, -10, 30, 30))
    		secondCrossView.layer.cornerRadius = 15
    		secondCrossView.image = UIImage(named: "Cross")
    		secondCrossView.tag = 200
    		secondCrossView.userInteractionEnabled = true
    		secondCrossView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "removeImage:"))
    		secondCrossView.hidden = true
    		
    		var thirdCrossView: UIImageView = UIImageView(frame: CGRectMake(90, -10, 30, 30))
    		thirdCrossView.layer.cornerRadius = 15
    		thirdCrossView.image = UIImage(named: "Cross")
    		thirdCrossView.tag = 200
    		thirdCrossView.userInteractionEnabled = true
    		thirdCrossView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "removeImage:"))
    		thirdCrossView.hidden = true
    		
    		var fourthCrossView: UIImageView = UIImageView(frame: CGRectMake(90, -10, 30, 30))
    		fourthCrossView.layer.cornerRadius = 15
    		fourthCrossView.image = UIImage(named: "Cross")
    		fourthCrossView.tag = 200
    		fourthCrossView.userInteractionEnabled = true
    		fourthCrossView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "removeImage:"))
    		fourthCrossView.hidden = true
    		
    		firstImageView.addSubview(firstCrossView)
    		secondImageView.addSubview(secondCrossView)
    		thirdImageView.addSubview(thirdCrossView)
    		fourthImageView.addSubview(fourthCrossView)
    	}

    Когда-то я это написал Оо

    def, 06 Августа 2018

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    https://hi-tech.mail.ru/news/bezdomnyj-programmist-potryas-internet-i-nashel-sebe-rabotu/
    
    https://htstatic.imgsmail.ru/pic_image/57220a54bde3086383d8e92babd58464/840/1120/1267156/
    
    1. Как бы "знает" все языки программирования, все фреймворки и все операционные системы;
    2. Гордится опытом интеграции "MailChimp" и установки SSL-сертификата от "Let'sEncrypt", выставляя это на первое место.

    HighVoltageDick, 06 Августа 2018

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