Image for post
Image for post
Photo by Lanju Fotografie on Unsplash

Do you have a Mac? If so, then you already have almost everything you need to get started writing apps for iPhones and iPads, and any other devices that run the iOS operating system. In this guide I will walk you through what you need to know about setting up a development environment, writing an app, and distributing it to users.

New apps for iOS are usually written using the Swift programming language. If you aren’t familiar with the Swift language there are many resources available to help you learn. If you are new to coding and looking for a fun approach, check out Swift Playgrounds. …


How to generate secure random passwords on macOS

Image for post
Image for post
Photo by Eric Prouzet on Unsplash

Sometimes you need a new password. For instance, you might be creating a service account, and you need to enter a password into a terminal or a text field somewhere.

If you know you’re going to have to type the password more than once, then you might be inclined to choose a password that is:

  • easy to type
  • easy to remember

But choosing a password based on this criteria would not be a great idea. These two qualities are not usually correlated with secure passwords. It would be much better to choose a password that is:

  • long
  • random

This approach might sound like more work. Fortunately, we can use the tools already present on our computers to easily generate a secure, random password of any length and have it automatically copied to the clipboard. …


Easy deployments with automatic SSL

Image for post
Image for post
Photo by Daniel Cheung on Unsplash

Deno is a simple, modern, and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust. Version 1.0 was recently introduced.

Vercel is a hosting provider for serverless functions and static sites. It supports zero-config deployment with automatic SSL and DNS management. It is easy to use and has a generous free tier.

The new vercel-deno runtime for Vercel makes it super easy to deploy serverless functions implemented using Deno. Let me show you how.

  • Install Deno.
  • Install Vercel and sign up.
  • Run vercel login and follow the instructions printed on the screen.
  • Create a new directory for your project and make it your terminal’s current directory. …

Safely increment a value using a field value

Image for post
Image for post
Photo by Matt Helbig on Unsplash.

In this tutorial, I will demonstrate how to implement a visitor counter that increments on every page refresh. The counter will be implemented using a Cloud Firestore database and an Express-based web app.

Cloud Firestore is a hosted NoSQL document database service available from the Google Cloud Platform. The service has a free tier that allows up to 1 GiB of stored data and tens of thousands of document reads and writes every day. The API and web console are both very easy to use.

Incrementing a value atomically is a simple concept, but it’s easy to get wrong if you are using a web framework that handles multiple requests concurrently or if your app is deployed to multiple instances. With traditional SQL databases, you would need to make sure that you read, incremented, and then wrote the value all within a single transaction in order to avoid possible data loss. …


Build a continuous deployment pipeline to App Store Connect

Image for post
Image for post
Photo by Nicolas Tissot on Unsplash.

In this tutorial, we are going to configure a GitHub repository to deploy iOS app releases to App Store Connect using GitHub Actions. We will create a GitHub Actions workflow that builds our iOS app project every time we push commits to GitHub and uploads our built app to App Store Connect every time we push a release tag.

We are going to keep things as simple as possible with regard to code signing and provisioning profiles. This should work well for simpler apps and projects with only one primary developer. …


A guide to setting multi-line JSON secrets

Image for post
Image for post
Photo by Courtnie Tosana on Unsplash

Cloud Firestore and Glitch can each be used to easily build powerful web apps for free and to scale the apps inexpensively. But it can be a little tricky to figure out how to configure them to work together. Read on to learn my technique.

Cloud Firestore is a hosted NoSQL document database service available from Google Cloud Platform. The service has a free tier that allows up to 1 GB of stored data and tens of thousands of document reads and writes every day. The API and web console are both very easy to use.

Glitch is a cloud-based collaborative programming environment service that deploys code as you type. Apps hosted on Glitch are automatically secured with SSL certificates and made available publicly on the internet. Apps on the service’s free tier are allowed up to 4,000 requests per hour and are put to sleep after a period of inactivity. …


Automate testing, signing, notarizing, and distribution

Image for post
Image for post
Photo by ray rui on Unsplash

Are you thinking about writing an app for macOS? Would you like to distribute it outside the Mac App Store using Homebrew? In this article, I describe how to use GitHub and GitHub Actions to set up continuous integration, delivery, and deployment for a Mac app signed with an Apple Developer ID. Best of all, if the app is open source, everything I describe is completely free to use! (If your app isn’t open source but is hosted in a private repository on GitHub, you can still do this for free, subject to limits.)

Why Is This Hard?

It used to be that you could just compile your code, package it in an archive or installer, put it on a site for download, and expect people to download it — not anymore. Thanks to the spread of malware, Apple has added restrictions to the operating system to prevent untrusted code from running. These restrictions complicate building and packaging. Furthermore, users who’ve used Homebrew expect to be able to install and keep up-to-date software from the command-line. This expectation complicates distribution, as well. …


Stop grieving and start acting like a senior engineer

Image for post
Image for post
Photo by Karim MANJRA on Unsplash

Have you heard of the six stages of debugging? I learned about them fifteen years ago while working as a junior engineer in Silicon Valley. I saw the following list hanging on a wall at work.

The Six Stages of Debugging

  1. That can’t happen.
  2. That doesn’t happen on my machine.
  3. That shouldn’t happen.
  4. Why is that happening?
  5. Oh, I see.
  6. How did that ever work?

Credit: Mike W. Cremer

I imagine most people see the humor in this list. If you’ve debugged software for long enough, you’ve probably experienced the truth of it, too.

I think part of the humor of this list comes from the way it echoes another popular-culture list of stages — the five stages of grief. The five stages, also known as the Kübler-Ross model, are denial, anger, bargaining, depression and acceptance. …


Enjoy better linting, testing, and debugging

Image for post
Image for post
Photo by Noah Silliman on Unsplash

Introduction

I’m here to show you how to trick out Visual Studio Code and take your React developer experience all the way to maximum awesome.

Spoiler alert! You can see the changes made in this tutorial by reviewing this commit.

Visual Studio Code

I love the Visual Studio Code editor. It has great support for JavaScript and TypeScript. On the surface it may look like a simple text editor, but with the right extensions and configuration its features can rival those of professional IDEs: intelligent code completion, continuous linting, continuous styling, continuous testing, and interactive debugging.

React

The React library is a popular and fun way to build front-end web applications. The Create React App project is an amazing way to get started with React quickly. Projects generated by Create React App include modern linting, compiling, bundling, and testing, all configured and ready to go, but with a command-line-centric developer experience. I’m going to show you how to unlock your project’s potential in Visual Studio Code. …


Debug like a pro in VS Code

Visual Studio Code and Chrome displaying the text “I love React debugging!”
Visual Studio Code and Chrome displaying the text “I love React debugging!”
Image source: author

Introduction

Sure, you can debug React apps using the tools provided by web browsers. But did you know that you can also debug your React app using a text editor? You can if your text editor is Visual Studio Code.

In this tutorial, I will show you how to go beyond the basic Visual Studio Code debugging configurations presented in documentation or other tutorials to create a slick debugging workflow in Visual Studio Code for a project generated with Create React App. The debugging workflow will start your React app and launch the web browser when you begin the debugging session, and stop the app when you end the debugging session. …

About

David Kramer

A maker and a leader.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store