Skip to content

Instantly share code, notes, and snippets.

View umer77's full-sized avatar

Muhammad Umer Farooq umer77

View GitHub Profile
@umer77
umer77 / Codility
Created January 24, 2021 19:10
Codility
Question
@umer77
umer77 / NetworkValidator.swift
Created June 15, 2020 18:30 — forked from Juantri94/NetworkValidator.swift
Network validator for swift
import Foundation
import SystemConfiguration
final class NetworkValidator {
static func isConnectedToNetwork() -> Bool {
var zeroAddress = sockaddr_in()
zeroAddress.sin_len = UInt8(MemoryLayout.size(ofValue: zeroAddress))
zeroAddress.sin_family = sa_family_t(AF_INET)
enum ScreenSize {
static let width = UIScreen.main.bounds.size.width
static let height = UIScreen.main.bounds.size.height
static let maxLength = max(ScreenSize.width, ScreenSize.height)
static let minLength = min(ScreenSize.width, ScreenSize.height)
}
enum DeviceType {
static let idiom = UIDevice.current.userInterfaceIdiom
static let nativeScale = UIScreen.main.nativeScale
@umer77
umer77 / README.md
Created July 31, 2018 23:08 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha: