Snippets Collections
pip install pandas-profiling

from pandas_profiling import ProfileReport
profile = ProfileReport(master_data, title="OMI v3.5 Profile Report")
profile.to_file("OMIv3.5_profilereport.html")
# A memory leak can occur in your application when an element is no longer attached to the Document Object Model (DOM) tree, but is still referenced by some JavaScript running on the page. These elements are called detached elements.
[https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/memory-problems/dom-leaks]
 
 
 a reference to an object will prevent the object referenced from being garbage collected.
 [https://developer.chrome.com/docs/devtools/memory-problems/memory-101/]
 
 
 # window leaks
 variables set on the window do not get collected
 - windwo.myvar = 'whatever'
 [https://medium.com/coding-blocks/catching-memory-leaks-with-chrome-devtools-57b03acb6bb9]
   func setProfileImage() {
        profileImageView.frame.size = CGSize(width: profileImageView.frame.height,
                                                  height: profileImageView.frame.height)
        profileImageView.layer.cornerRadius = profileImageView.layer.frame.height/2
        profileImageView.center.x = view.center.x
    }
var imagePicker = UIImagePickerController()
var imagePicked = false


    @IBAction func updateProfilePressed(_ sender: Any) {
        let email = emailTextField.text ?? ""
        let phone = phoneNumberTextField.text ?? ""
        
        if nameTextField.text == "" {
            self.showToast(message: "Please enter name")
            return
        } else if !isValidPhone(phone) {
            self.showToast(message: "Please enter a valid phone number")
            return
        }
        
        if imagePicked {
            DB.getImageUrl(profileImageView) { imageUrl in
               let data = [
                    "profileUrl" : imageUrl,
                    "name" : self.nameTextField.text ?? "",
                    "phoneNumber": self.phoneNumberTextField.text ?? "",
                ]
                self.saveData(data)
            }
        } else {
           let data = [
                "name" : self.nameTextField.text ?? "",
                "phoneNumber": self.phoneNumberTextField.text ?? "",
            ]
            self.saveData(data)
        }
    }
    
    func saveData(_ data : [String:Any]) {
        
        let userId = Auth.auth().currentUser?.uid ?? ""
        
        DB.updateDocument("ServiceProviders", userId, data, merge: true) { success in
            if success {
                self.showToast(message: "Profile Updated!")
            }
        }
    }


// MARK: - Image Picker

extension ProfileViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
    
    func enableImageViewTapGesture()
        {
            let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(profileImageTapped(tapGesturerecognizer:)))
            profileImageView.isUserInteractionEnabled = true
            profileImageView.addGestureRecognizer(tapGestureRecognizer)
        }
    
    @objc func profileImageTapped(tapGesturerecognizer: UITapGestureRecognizer){
        
        if UIImagePickerController.isSourceTypeAvailable(.savedPhotosAlbum){
            print("Button capture")
            imagePicker.delegate = self
            imagePicker.sourceType = .savedPhotosAlbum
            imagePicker.allowsEditing = true
            
            SVProgressHUD.show()
            present(imagePicker, animated: true) {
                SVProgressHUD.dismiss()
            }
        }
        else {
            print("No")
        }
    }
    
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        
        if let pickedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
            imagePicked = true
            profileImageView.layer.cornerRadius = profileImageView.bounds.width/2
            profileImageView.image = pickedImage
        }
        self.dismiss(animated: true, completion: nil)
    }
    
    func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
        
        dismiss(animated: true, completion:nil)
    }
}
star

Fri Aug 04 2023 07:02:18 GMT+0000 (Coordinated Universal Time) https://www.analyticsvidhya.com/blog/2021/06/generate-reports-using-pandas-profiling-deploy-using-streamlit/

#pandas #profile
star

Thu Jul 27 2023 22:02:58 GMT+0000 (Coordinated Universal Time) https://github.com/SapphireElite

#web #link #weblink #profile #dashboard
star

Sat Mar 25 2023 23:18:06 GMT+0000 (Coordinated Universal Time) https://myaccount.google.com/profile/profiles-summary

#profile #seo #google #website #development #marketing
star

Sun Jul 24 2022 11:49:03 GMT+0000 (Coordinated Universal Time)

#memory #performance #profile #garbage-collection
star

Tue Mar 15 2022 11:50:41 GMT+0000 (Coordinated Universal Time)

#ios #swift #profileimage #image #profile #snippet

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension