This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dictionarize(s, d={}, key=None): | |
""" | |
Simple recursive function to convert a yaml literal block string ("|-") to yaml-valid python dictionary | |
Args: | |
s, str: yaml-valid input string | |
d, dict: output dictionary | |
key, str: key in the dictionary at which to add nested values | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "\nEnter your storage account name:" | |
read AZ_ACCOUNT_NAME | |
echo "\nEnter your container name:" | |
read AZ_BLOB_CONTAINER | |
echo "\nEnter your SAS token (just hit ENTER/RETURN if not applicable):" | |
read AZ_SAS_TOKEN | |
DATE_NOW=$(date -Ru | sed 's/\+0000/GMT/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Swifty Fonts allows iOS developers (i.e. you) to view all fonts that are | |
natively available in Swift. You can see each font against various | |
background colors to see if a particular font is available by default in | |
Swift and to see if it is a font that you would like to employ in your | |
app(s). | |
Instead of Swifty Fonts being a standalone app, it is now a part of Swifty | |
Docs to allow Swift coders (especially noobs) to have access to more tools, | |
including notes on how to get started developing augmented reality | |
applications. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UITableView is a fundamental tool within the UIKit framework that all Swift | |
developers should be familiar with. Table views are all over iOS apps, | |
including several apps that shipped natively on your iPhone. Your inbox on | |
the Mail app makes use of a UITableView. The Settings app is riddled with | |
UITableViews. The Notes, Contacts, and Reminders apps all use UITableViews, | |
too. I think you get it - table views are all over the place! | |
Check out the table views in this app and see how they were created by the | |
"About" button in the top-right corner of each view controller. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Augmented reality is a game changer. From gaming and entertainment to | |
navigation to medical training and beyond, AR will change the way we | |
interact with the world. Whether it’s on our smartphones or some kind of | |
smart glasses is yet to be determined, but some of the world’s biggest | |
companies (Apple and Google, for example) are investing heavily in the | |
technology. The world will need talented developers (like you, obviously) to | |
move the industry forward. | |
It’s surprisingly easy to get started building AR applications using ARKit | |
(Apple’s framework for creating augmented reality experiences), and very |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use tableView(_:cellForRowAt:) to customize the cells in a table view. | |
// This example demonstrates an instance of how one of this app's table views uses this method. | |
// Create some sort of data source. This is often an array or, in this case, a dictionary. | |
var dataSource: [String: String] { | |
return ["cellForRowAt: indexPath": "Update cell information based on the data source\nReturns a UITableViewCell.", | |
"numberOfRowsInSection: Int": "Determine the number of rows needed for each section of the tableView\nReturns an Int", | |
"titleForHeaderInSection: Int": "Set the title for a particular section of your tableView\nReturns a String"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use tableView(_:titleForHeaderInSection:) to set the title for each section in a table view. | |
// This example exhibits two instances of this method used in this app. | |
// This demonstrates the use of this method in this app's UITableViewDataSource view controller. | |
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { | |
switch section { | |
case 0: | |
return "Configuring a Table View" | |
default: | |
print("out of index") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use tableView(_:numberOfRowsInSection:) to determine the number of rows each section of a UITableView should display. | |
// This example exhibits how this app makes use of this method. | |
// Create some sort of data source. This is often an array or, in this case, a dictionary. | |
var dataSource: [String: String] { | |
return ["cellForRowAt: indexPath": "Update cell information based on the data source\nReturns a UITableViewCell.", | |
"numberOfRowsInSection: Int": "Determine the number of rows needed for each section of the tableView\nReturns an Int", | |
"titleForHeaderInSection: Int": "Set the title for a particular section of your tableView\nReturns a String"] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use tableView(_:editActionsForRowAt:) to implement swipe actions for a UITableView's cells. | |
// This example exhibits how this app makes use of this method. | |
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { | |
// Get the title of each section to notify the user that a cell in a particular section was swiped. | |
let sectionHeaderView = tableView.headerView(forSection: indexPath.section) | |
let sectionTitle = sectionHeaderView?.textLabel?.text | |
// Create an action. Create custom actions in the UITableViewRowAction's closure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use tableView(_:didSelectRowAt:) to manage what happens when a user selects a UITableViewCell. | |
// This example exhibits how this app makes use of this method. | |
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
// Determine what to do when a cell in a particular section is selected. | |
switch indexPath.section { | |
case 0: | |
// If the cell in the first section is selected, this will trigger the segue with the "toHeightForRowAt" identifier | |
self.performSegue(withIdentifier: "toHeightForRowAt", sender: nil) |
NewerOlder