Author Archives: Rex

Choices

The following involves research which may or may not be true.

The first study1 suggests we learn faster when we freely choose what to learn (as opposed to being forced). With agency, we are in control and change how we learn from our experiences.

However, this can also backfire as we can become delusional and think that we have control when we don’t. For example, following a sports superstition that does not change the game’s outcome.

The second research2 suggests that we like things because we chose them. This is backwards, since common sense dictates we choose things because we like them. This is really interesting since it suggests we rationalize our choice after the fact or ipso facto (by the fact itself).

These two phenomenons pair together and raise all kind of questions. Imagine a kid who freely chooses basketball and gets much better (than their peers who may not have chosen it). Does the kid like the sport since they are good at it or because they chose to play it in the first place? Of course, someone can have multiple reasons for why they like something, and it’s impossible to generalize since there are so many individual environmental factors to consider.

As a parent, I wonder how this can be utilized, and I don’t mean in some nefarious way. I take it to mean encouraging kids to pursue playing, reading, or learning whatever they want to. That way they will enjoy how they spend their time since they chose it.

Choice is a powerful thing, but it can also be paralyzing. With too many choices, you can waste a lot of time trying to find the best decision. The paradox of choice. Sometimes, I feel overwhelmed sometimes with prioritizing how I should be spending my free time. I don’t have an answer for this besides “do your best”, and the research suggests you will like it since you chose it. How amazing is that?


  1. Chambon, V., Théro, H., Vidal, M. et al. Information about action outcomes differentially affects learning from self-determined versus imposed choices. Nat Hum Behav 4, 1067–1079 (2020). https://doi.org/10.1038/s41562-020-0919-5
  2. Silver, A. M., Stahl, A. E., Loiotile, R., Smith-Flores, A. S., & Feigenson, L. (2020). When Not Choosing Leads to Not Liking: Choice-Induced Preference in Infancy. Psychological Science. https://doi.org/10.1177/0956797620954491

Manage Sandbox Account on iPhone (iOS 14)

While working with iOS 14 and IAPs, I was looking for the Sandbox Account management section in iOS Settings. Older guides online reference “iTunes & App Stores”, but it is somewhere else now.

From what I’ve read online, it seems like the 1st step is to attempt an IAP on your iPhone running your development build (with Xcode). You’ll be prompted to sign in, so use your App Store Connect Sandbox Tester credentials.

Afterwards, I was able to find Sandbox at the following location:
* open Settings app
* scroll down & select ‘App Store’
* scroll down & find ‘SANDBOX ACCOUNT’

Here, you can manage or sign out of your Sandbox Apple ID.

Downgrading from iOS 14 beta to iOS 13

I’ve spent several hours on this (restoring from an old computer), so here’s how I was able to restore iOS 13 (the current, non-beta iOS release). First things first, I backed up my iPhone to my computer before installing iOS 14 beta 6.

First attempt (did not work)

My iPhone backup was under iOS 13.6. Version 13.6.1 had been released, but I did not update my phone to it. I installed iOS 14 beta 6 using Apple’s profile.

Once I decided to downgrade to iOS 13, I removed the beta profile on my phone in Settings. I tried to follow Apple’s guide for removing the developer beta. The instructions for putting your device in recovery mode was confusing. I found that I had to hold the Side button for a long time.

After plugging in my phone, I think I clicked “Restore Backup”. iTunes told me that it had to download 13.6.1 first. I clicked through the notice and assumed that iTunes was going to restore my 13.6 backup and update my phone to 13.6.1. Sure, ok, iTunes do the thing.

3 hours later, my phone was restored, but it was still on the latest iOS 14 beta.

Second attempt (success)

iOS 13.7 had just come out. So I downloaded the 13.7 .ipsw file at https://developer.apple.com/download/release/#ios-restore-images-iphone-new. Also, I logged out of Find My (iPhone).

After connecting my phone to my computer, I opened iTunes and shift-clicked (PC) on “Restore iPhone…”. Warning: this wipes your iPhone. I found my downloaded .ipsw file for iOS 13.7 and let iTunes format my phone.

With my phone on 13.7, I went back to iTunes to “Restore Backup” using my 13.6 backup. 3 hours later, my phone is back on iOS 13!

New app alert (Copy Cleaner for macOS)

I’ve just released my first macOS app, a menu bar app. It’s called Copy Cleaner and it works in the background to remove tracking from URLs that are copied to your clipboard. The UX is very seamless since you use your mac normally, and common trackers (utm_source, etc) are removed automatically for you.

Working on a macOS app (on the mac App Store) was a nice diversion for me. I’m used to working in Xcode, but not on mac apps. Granted a menu bar app is different from a traditional desktop application that sits in your dock.

I built this app since it’s tackles something that I run into weekly. When I’m browsing iOS, JS, ruby, etc. newsletters, I end up clicking on many long URLs – filled with query trackers. By building this app, I don’t have to clean up my URLs manually any more. This app takes care of it.

Example

Copy this: https://www.example.com/?utm_source=newsletter&sfmc_activityid=abc12345-1234-1234-abcd-12345abcdefg&sfmc_id=123456789&utm_campaign=campaign-id-2020&utm_content=123456&utm_id=abcdefgh-1234-5678-9101-123a123abcde&utm_medium=email&utm_term=email%2campaign

You’ll paste this: https://www.example.com/

That’s it. The app works silently in the background. With Apple’s Clipboard and the app running on your mac, the URL cleaning works on both mac & iPhone.

Let me know if you have any questions. You can reach me on Twitter @rexfeng

P.S. – We’re on Product Hunt!

zsh PS1 setup

macOS Catalina uses zsh as the new default shell (instead of bash) in Terminal. This means that many people will be looking to re-setup their CLI with ~/.zshrc instead of ~/.bash_profile.

While customizing my .zshrc was a hassle, it was also an opportunity to clean up my profile and remove legacy settings.

Zsh offers an optional right side prompt, but I only used the left side prompt for now.

Here are some misc tips that I’ve found helpful:

  • For basic PS1 exports (time/date, current dir, user, etc), you can find examples here. Things like %D for the current date, %~ for the current directoy, and more.
  • In your PS1 export, you can start color formatting with %F{117} and end color formatting with %f. Replace 117 with whatever color your desire. You can find color codes here.
  • You can make your tab auto completion case insensitive (ignore case) by adding:
    zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}'
    autoload -Uz compinit && compinit -i
  • You can show your current git branch with:
    autoload -Uz vcs_info
    precmd() { vcs_info }
    zstyle ':vcs_info:git:*' formats '(%b)'
    setopt prompt_subst

    Note: you also need to add $vcs_info_msg_0_ in your PS1 export line.

I’ve thought about creating a zshrc WYSIWYG tool, ala Halloween Bash, but I’ve shelved those plans since there’s only so much time in a day. With macOS Catalina inevitable for macOS users, more and more people are going to be looking for easy ~/.zshrc customization.

Kauai, Hawaii Trip Recap

Last month, I was blessed to be able to spend a few days in Kauai (Hawaii) with family. The island is green, tropical, and beautiful.

We stayed at the Grand Hyatt in the south side of the island. The resort was great and there’s plenty of things to do on the south side. Around Koloa/Poipu, where our hotel was, there were lots of great things to eat. We enjoyed shaved ice at Waikomo Shave Ice, where they use fresh fruit. Puka Dog was good, since they combine a hot dog with fruity relish & Hawaiian mustard. Puka Dog is famous since Anthony Bourdain ate there.

On the day with the best (relative) weather, we drove up to Waimea Canyon State Park. The view from the canyon lookout was great, but weather & visibility changes fast. As we were taking photos of the canyon, the area fogged up and we couldn’t see much. We drove to the nearby Kōkeʻe State Park, but we couldn’t see anything due to the fog & rain. As we drove down the mountain, the weather improved and we were able to get decent views from roadside lookouts.

Leaving Waimea Canyon, we stopped at the town of Waimea for lunch. There were plenty of shops, and we enjoyed the Shrimp Station. Heading back towards our hotel, we also stopped at the small town of Hanapepe. Hanapepe’s main street was small, and there was cool Lilo & Stitch art among the shops. Unfortunately, the Hanapepe Swinging Bridge was closed on our visit.

The next day, we went up to the north side of the island (by driving along the east side). We stopped by Opaeka’a Falls along the way, and it was worth it since the double waterfall is easily accessible near the parking lot. We checked out Kilauea Lighthouse, which is cool for bird enthusiasts. The lighthouse was windy and packed with visitors.

After the lighthouse, we headed to Hanalei. The Hanalei Valley Lookout was definitely worth stopping along the highway for a nice view. Hanalei was a cool town with lots of restaurants and shops. Unfortunately it rained a lot while we were there. We ate at Hanalei Bread Company and Wishing Well Shave Ice. Hanalei Bread Company was really popular, but they seem to run out of things. Wishing Well Shave Ice was really good, but we had to dodge the rain. I wish we stayed longer in Hanalei to browse the shops, but the weather was too much. We left to check out nearby Princeville, but Princeville seemed very hostile to visitors as there’s no public parking?

Besides driving around the island, we were able to enjoy our hotel pool & beach. We weren’t able to spend much time exploring the east side, but we did enjoy a plate lunch from Mark’s Place (get the Korean Chicken!). Having stayed on the south side, I would definitely recommend the south side. Kauai was fun, and there were wild chickens everywhere.

Using the MIYA Pro Mac Keyboard

I recently picked up the Ducky MIYA Pro Mac White LED 65% Dye Sub PBT Mechanical Keyboard. This seems to be a rebranded Varmilo keyboard as the cables are branded with Varmilo.

The form factor (tenkeyless) is nice and compact. The lack of numpad on the right gives me much more space for my mouse. As expected from a mechanical keyboard, the sound of the keys is noticeable.

I went with Cherry MX Brown switches. The keyboard typing feel is nice but requires more effort than a flat chiclet keyboard.

I went with this keyboard since I wanted different things: 1.) mac support, 2.) tenkeyless, and 3.) cherry mx browns.

The keyboard comes with an instruction manual in Chinese & English. I find the documentation to be lacking. You’d think a keyboard would be plug and play, but this keyboard is more complicated due to the top row sharing Number keys & Mac media/shortcut keys.

When I got my keyboard, it took me some time to figure out that Fn + A turns the keyboard into Mac mode. Fn + W would change it back to the default, Windows mode. I also had to activate “default mode” (it’s unclear to me what this means) by pressing Fn + D to be able to use the Number keys as numbers and have my Mac recognize the keyboard configuration.

Other things that confused me for a bit was the PgUp & PgDn alternating lights. Apparently one or the other never turns off? This is annoying for someone who values the little details and prefers certain aesthetics. I’ve read online that it lights up (one or the other) to indicate whether the keyboard’s top row is in Numbers mode or Media mode. To switch between the two, it’s Fn + PgUp for Numbers and Fn + PgDn for Media.

To use F1-F12, it’s Fn+PgDn, then Fn+F1 for F1 (and so on through F12).

As a software engineer, it took some time to figure out that Fn + Esc activates the backtick key (`).

Overall, the small form factor & hearty typing key feel are great. It’s unfortunate that a keyboard has a learning curve, but that’s the price to pay for a condensed layout where keys have double or triple duty.

How to install iOS 13 beta (for developers)

With an Apple developer account, you can install the iOS 13 beta. Warning: you should backup your existing device before installing the iOS 13 beta, and “install only on systems you are prepared to erase if necessary.”

From the Apple Developer Download page, you can find the Restore Images. Find your device among the list at https://developer.apple.com/download/#ios-restore-images-iphone-new to download the .ipsw

Next use iTunes & follow Apple’s guide (Installation Using the Restore Image)

  • Make sure you are running the latest version of iTunes on your Mac.
  • Open iTunes on your Mac.
  • Connect your iOS device to your computer with the cable that came with your device.
  • If you’re prompted for your device passcode or to Trust This Computer, follow the onscreen steps. If you forget your passcode, help is available.
  • Select your iOS device when it appears in iTunes.
  • In the Summary panel, hold the Option key and click the Check for Update button.
  • Select the iOS beta software restore image and click Open to start the installation.
  • After installing the beta, your device will reboot and will require a network connection to complete activation.

Follow the on screen instructions and you’ll have iOS 13 beta running on your device.

Note: I ran into an error “Can’t install the software because it is not currently available from the Software Update server”. I waited for my iPhone to fully boot up and I’m able to use iOS 13 beta (despite that error message).

Overall, the experience wasn’t too bad. This is a developer beta and not intended for widespread public distribution. If you are interested in the public beta for iOS 13, you can sign up here https://beta.apple.com/sp/betaprogram/

hiatus

In the past, I’ve tried to post consistently (monthly) and the results have been mixed. I’ve posted some useful tutorials and lots of posts for the sake of posting.

For now, I no longer want to stick to a routine schedule of random content. With some (super minor amount of) time freed up, I’m sure I’ll be able to waste it surfing the web, working on iOS apps, or simply doing life.

I can still see myself posting content (tips, tutorials, observations, etc.) here, but it’ll be more intentional.

Best,
-Rex

iOS Developer iPhone (Dec 2018)

As an indie iOS app developer, keeping up with Apple’s hardware can get expensive fast. From the Mac to the iPhones and iPads.

I’m focusing on native iPhone apps and currently use an iPhone 7 as my daily driver. I’m considering getting a new iPhone and want to find the right balance between 1.) phone size I want to use daily and 2.) phone is optimal for App Store Connect previews (videos) & screenshots.

Since I’m an AR app developer, having iPhone hardware is essential (the Simulator doesn’t cut it).

Looking at the state of iPhone hardware today (Dec 2018), some quick Googling shows that the iPhone 7, 7+/8+, and X form factors are the most common in the US.

When we look at Apple’s App preview & screenshot guidelines, it tells us that the 5.5 inch (iPhone 8+, etc) form factor is required (screenshots) and recommended (app previews).

For 2019, my guess is that supporting the 5.5 inch (8+) form factor and the 5.8 inch (X/XS) on App Store Connect would give me the most bang for my buck. It would be nice to have both a XS & XS Max to test with, but that’s way out of my budget.

Curiously enough, the app preview video resolutions are the same across the X line (X, XS, XS Max, XR at 886 x 1920 pixels (when portrait). The video resolution is bigger at 1080 x 1920 pixels for the plus line (8+, etc).

Using App Store Connect, I was able to manually verify the different screenshot upload resolutions for the iPhone XS Max (1242 × 2688), iPhone XS (1125 × 2436), and iPhone 8+ (1242 × 2208). It seems like there is no point to try to take or upload iPhone XR screenshots.

In summary, the iPhone plus (8+, etc) line is the most important for app previews & screenshots. After that, the XS & XS Max (in that order) will give you more App Store Connect coverage with diminishing returns.