Duc Ninja

Multiple Accounts and SSH Keys

Multiple SSH keys Problem is, Bitbucket doesn’t allow you to use the same SSH key with more than one Bitbucket account. I still have my old work account to tidy up loose ends. As GitHub explains you can generate an SSH key like so: cd ~/.ssh ssh-keygen -t rsa -C "[email protected]" You are then prompted for an optional password. Afte...
Read more ...

Tips to be more productive with Xcode

⌃: Control ⌘: Command ⌥: Option ⇧: Shift ⏎: Return 1. Decide Where to Open a File In Xcode, you can open a file in various ways: in the standard editor, in a new or existing assistant editor, in a new or existing tab, or in a new window. Here’s how you can decide about this: When clicking on a file in the Navigator, hold down ⇧ + ⌥ When clicki...
Read more ...

Swift encoding and decoding

Encoding and decoding with Swift 4 Swift 4 lets you serialize your custom data types to JSON without writing any special code. // encoding.swift struct Language: Codable { var name: String var version: Int } let swift = Language(name: "Swift", version: 4) let php = Language(name: "PHP", version: 7) let perl = Language(name: "Perl", ve...
Read more ...

Migrating to Swift 4

In the past, migrating your code was a big deal when a new version of Swift was introduced – when Swift 3 came around, it seemed like every line of code had a syntax change. This time around, however, life should be a lot easier on us – in fact maybe you’ll even see this nice message during your migration: Here’s what Chris Lattner said about...
Read more ...