Programming

My notes on how to use git

, , No Comment

1) create a local git repo $ git init 1.5) Save username and password for github $ git config credential.helper store $ git push http://example.com/repo.git Username: <type your username> Password: <type your password> 2) Add…

Read Post →

Installing Visual Studio Code on RHEL

, , No Comment

RHEL, Fedora, and CentOS based distributions We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository: sudo rpm –import https://packages.microsoft.com/keys/microsoft.asc sudo sh -c ‘echo…

Read Post →

Detecting iPad or iPhone in swift

, , No Comment

To detect if the user is using an iPad or iPhone or something else in Swift do something like this: switch UIDevice.current.userInterfaceIdiom { case .phone: deviceLavel.text = “iPhone” case .pad: deviceLavel.text = “iPad” case .unspecified:…

Read Post →

Optionals in Swift 3

, , No Comment

Swift Optionals A type the either has a “wrapped” value or is nil. e.g. let imagePaths = [“star”: “/glyphs/star.png”,”portrait”: “/images/content/portrait.jpg”,”spacer”: “/images/shared/spacer.gif”] Getting a dictionary’s value using a key returns an optional value, so imagePaths[“star”] has…

Read Post →