Skip to content

Instantly share code, notes, and snippets.

@tesddev
tesddev / UITabBarExtension.swift
Last active May 19, 2023 22:59
Tab bar extension for hiding and showing tab bars in certain view controllers
/// Extension written by: @BrentMifsud, usage and slight modification by @tesddev
extension UITabBarController {
/// Extends the size of the `UITabBarController` view frame, pushing the tab bar controller off screen.
/// - Parameters:
/// - hidden: Hide or Show the `UITabBar`
/// - animated: Animate the change
func setTabBarHidden(_ hidden: Bool, animated: Bool) {
guard let vc = selectedViewController else { return }
guard tabBarHidden != hidden else { return }
@tesddev
tesddev / EmptySnippet.swift
Created May 23, 2023 10:20
Snippet For Empty List TableView Background View
/// define label or image as needed, here, an image
var emptyListLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.textColor = .black
label.text = "No shipment with the selected filter!"
label.font = UIFont.systemFont(ofSize: 11)
label.numberOfLines = 0
return label
}()
@tesddev
tesddev / CountryNamesInArrayOfStrings
Created September 27, 2023 16:38
Country list in array of string
@State private var countries = [
"Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "Colombia", "Comoros", "Congo", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea-Bissau", "Guinea", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran
@tesddev
tesddev / wordpressSetupAutomation.txt
Created May 1, 2024 21:23
Automating Wordpress Setup
sudo apt update
sudo apt install apache2 \
ghostscript \
libapache2-mod-php \
mysql-server \
php \
php-bcmath \
php-curl \
php-imagick \
php-intl \